/* ---------- Verwaltung / Dashboard ---------- */
/* Leonardo-Hotels-Palette: Crimson #B50038 auf Weiß */
:root {
  --bg: #f7f5f6;
  --card: #ffffff;
  --ink: #231f22;
  --muted: #75696e;
  --line: #eae2e5;
  --brand: #B50038;
  --brand-dark: #8f002c;
  --brand-ink: #ffffff;
  --rose: #fbeef2;
  --rose-line: #efd2db;
  --accent: #B50038;
  --danger: #c23b3b;
  --ok: #2e8b57;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(90, 10, 40, 0.07), 0 4px 16px rgba(90, 10, 40, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Noto Sans", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.layout { display: flex; min-height: 100vh; }

/* ----- Sidebar ----- */
.sidebar {
  width: 230px;
  flex: 0 0 230px;
  background: #ffffff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
}
.sidebar .brand {
  display: flex;
  justify-content: center;
  padding: 20px 16px 16px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.sidebar .brand img { width: 132px; height: auto; border-radius: 12px; }
.sidebar nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; background: #ffffff; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #111111;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
}
.sidebar nav a:hover,
.sidebar nav a.active { background: rgb(181, 0, 56); color: #ffffff; }
.sidebar nav a .ico { width: 20px; display: flex; align-items: center; justify-content: center; }
.sidebar .foot { padding: 14px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ----- Topbar ----- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 650; }
.topbar .spacer { flex: 1; }

/* Menü-Knopf (nur auf schmalen Bildschirmen sichtbar) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 9px;
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle:hover { border-color: var(--brand); color: var(--brand); }
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 20, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; }

/* Benutzer-Menü oben rechts */
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(10, 16, 34, 0.18);
  padding: 6px;
  z-index: 60;
}
.user-pop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: none;
  border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--ink);
  text-decoration: none;
}
.user-pop-item:hover { background: var(--rose); color: var(--brand); }

/* ----- Persönliches dunkles Erscheinungsbild der Verwaltung ----- */
:root[data-theme="dark"] {
  --bg: #14121a;
  --card: #1e1b26;
  --ink: #ece9f1;
  --muted: #a49db3;
  --line: #322d3d;
  --rose: #2a2233;
  --rose-line: #43384f;
  --soft: #241f2e;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
}
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .sidebar .brand,
:root[data-theme="dark"] .sidebar nav { background: #1a1722; }
:root[data-theme="dark"] .sidebar { border-right-color: var(--line); }
:root[data-theme="dark"] .sidebar nav a { color: #cfc8db; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #14121a; color: var(--ink); }
:root[data-theme="dark"] .stat, :root[data-theme="dark"] .day-col, :root[data-theme="dark"] table.cal th { background: var(--soft); }
:root[data-theme="dark"] table.cal td.roomcol, :root[data-theme="dark"] table.cal th.roomcol { background: var(--soft); }
/* Alle hellen Komponenten-Flächen im Dunkelmodus dunkel machen */
:root[data-theme="dark"] .seg,
:root[data-theme="dark"] .richbar button,
:root[data-theme="dark"] .richtext,
:root[data-theme="dark"] .picker-card,
:root[data-theme="dark"] .ticket-row,
:root[data-theme="dark"] .today-row,
:root[data-theme="dark"] .live-tile,
:root[data-theme="dark"] .dz-file,
:root[data-theme="dark"] .az-btn,
:root[data-theme="dark"] .user-pop,
:root[data-theme="dark"] .modal { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .company-chosen,
:root[data-theme="dark"] .day-col,
:root[data-theme="dark"] .dropzone,
:root[data-theme="dark"] .layout-panel { background: var(--soft); }
:root[data-theme="dark"] .btn { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .btn:hover { background: var(--rose); }
:root[data-theme="dark"] .btn.primary { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn.accent { background: var(--brand); color: #fff; }
:root[data-theme="dark"] table.cal td.cell:hover,
:root[data-theme="dark"] table.cal td.cell.today,
:root[data-theme="dark"] .today-row:hover,
:root[data-theme="dark"] .ticket-row:hover { background: var(--rose); }
:root[data-theme="dark"] .nav-badge { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .richtext:empty::before { color: #6f6880; }
/* Logo-Flächen bleiben bewusst weiß – Logos brauchen hellen Hintergrund */
:root[data-theme="dark"] .book-logo,
:root[data-theme="dark"] .today-logo,
:root[data-theme="dark"] .picker-card .pic img,
:root[data-theme="dark"] .company-chosen img { background: #fff; }

.content { padding: 24px 26px 60px 26px; }

/* ----- Buttons, inputs ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: #dcc2cc; background: #fdf7f9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.accent:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn.danger-solid:hover { background: #a93030; }
.btn.danger:hover { background: #fdf1f1; border-color: #ecc9c9; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

label.field { display: block; margin-bottom: 14px; }
label.field span.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #e4b9c8; border-color: #e4b9c8; }
textarea { resize: vertical; min-height: 60px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ----- Cards ----- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 14px; }
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 28px; font-weight: 650; color: var(--brand); }
.stat .cap { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ----- Tables ----- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
table.list tr:last-child td { border-bottom: none; }

/* ----- Week calendar (Ausschilderung) ----- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-toolbar .week-label { font-size: 16px; font-weight: 650; min-width: 210px; text-align: center; }
/* Datumsauswahl: Kalender-Knopf, das echte Datumsfeld liegt unsichtbar darüber */
.date-pick-wrap { position: relative; display: inline-flex; }
.date-pick-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.cal-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.cal { border-collapse: collapse; width: 100%; min-width: 900px; table-layout: fixed; }
/* Raum-Spalte schmal halten, damit die 7 Tage ohne Seitwärts-Scrollen passen */
table.cal col.roomcolw { width: 96px; }
table.cal col.daycolw { width: auto; }
table.cal th, table.cal td { border: 1px solid var(--line); vertical-align: top; }
table.cal th {
  background: #faf6f7;
  padding: 8px 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
table.cal th.today { background: var(--rose); color: var(--brand); }
table.cal td.roomcol, table.cal th.roomcol {
  background: #faf6f7;
  padding: 7px 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
  position: sticky;
  left: 0;
  z-index: 3;
}
table.cal td.roomcol small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
table.cal tr.floor-row td {
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  position: sticky;
  left: 0;
}
table.cal td.cell { height: 44px; padding: 0; cursor: pointer; }
table.cal td.cell:hover { background: #faf3f5; }
table.cal td.cell.today { background: #fdf6f8; }
table.cal td.cell.today:hover { background: var(--rose); }

.chip {
  display: block;
  padding: 3px 7px;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.35;
  background: var(--rose);
  border-left: 3px solid var(--brand);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.chip:hover { filter: brightness(0.96); }
.chip:not(.ghost) { cursor: grab; }
.chip.dragging { opacity: 0.45; }
td.cell.drop-target {
  outline: 2px dashed var(--brand);
  outline-offset: -2px;
  background: var(--rose) !important;
}
.chip .t { font-weight: 650; margin-right: 4px; }
.chip.blocker { background: #f3f3f4; border-left-color: #8b8f99; color: #565b66; }
/* Kombinierte Räume: identische Voll-Farbe in beiden Einzelraum-Zeilen –
   die Zellen wirken dadurch optisch verbunden */
.chip.combo {
  background: var(--brand);
  border-left-color: var(--brand-dark);
  color: #fff;
}
.chip.combo .t { color: #fff; }

/* ----- Dialog-/Seiten-Tabs ----- */
.dlg-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
}
.dlg-tab {
  border: 0;
  background: none;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.dlg-tab:hover { color: var(--ink); }
.dlg-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ----- Kompakter Veranstaltungsdialog ----- */
#eventForm.compact .field { margin-bottom: 10px; }
#eventForm.compact h2 { margin-bottom: 12px; }
#eventForm.compact .actions { margin-top: 14px; }
.times-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-pair { display: grid; grid-template-columns: 1.5fr 1fr; gap: 6px; }
.ico-btn { padding: 7px 10px; gap: 6px; }
.layout-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #faf6f7;
}
/* Gruppen-Überschriften in Panels und Einstellungs-Karten */
.lp-sec {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin: 14px 0 8px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.lp-sec.first { margin-top: 0; padding-top: 0; border-top: none; }

/* Einstellungen: Optionen links, Live-Vorschau rechts */
.set-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 20px;
  align-items: start;
}
.set-right { position: sticky; top: 76px; }
@media (max-width: 1200px) {
  .set-cols { grid-template-columns: 1fr; }
  .set-right { position: static; }
}
/* Kompaktes 2-Spalten-Raster: Segmente/Design oben, Schalter mittig, Regler unten */
.lp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.lp-grid .ctl-row { display: block; margin-bottom: 0; }
.lp-grid .ctl-lbl { display: block; margin-bottom: 4px; }
.lp-grid select { padding: 5px 8px; font-size: 13px; }
.lp-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
/* Untergruppen ohne eigene Trennlinien (die Gruppierung macht .lp-sec) */
.lp-toggles.plain { border-bottom: none; padding: 2px 0 8px 0; margin-bottom: 0; }
.lp-grid.plain { border-bottom: none; padding-bottom: 4px; }
.lp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}
.lp-toggle input { width: auto; accent-color: var(--brand); }
.lp-slider { margin-bottom: 8px; }
.lp-slider:last-child { margin-bottom: 0; }
.lp-slider input[type="range"] { margin-top: 3px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.ctl-row:last-child { margin-bottom: 0; }
.ctl-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button {
  border: 0; background: transparent; padding: 6px 11px; cursor: pointer;
  color: var(--muted); display: flex; align-items: center;
  border-right: 1px solid var(--line); font-family: inherit;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--rose); color: var(--brand); }
.seg button.active { background: var(--brand); color: #fff; }
.seg button.seg-txt { font-size: 13px; font-weight: 650; padding: 7px 16px; }
.switch-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; color: var(--ink); }
.switch-lbl input { width: auto; accent-color: var(--brand); }
input[type="range"] { accent-color: var(--brand); }
input[type="checkbox"] { accent-color: var(--brand); }

/* ----- Modal ----- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(20, 26, 44, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-back.open { display: flex; }
.modal {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  padding: 22px 24px;
  box-shadow: 0 10px 40px rgba(10, 16, 34, 0.25);
}
.modal h2 { font-size: 17px; margin-bottom: 16px; padding-right: 32px; }
.modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.modal-x:hover { background: var(--rose); color: var(--brand); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal .actions .left { margin-right: auto; }

.modal.wide { max-width: 860px; }
.modal-cols { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 22px; align-items: start; }
.modal:has(.modal-cols) { max-width: 1150px; }
/* Speichern/Löschen bleiben immer sichtbar und werden nie überdeckt */
.modal .actions {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 12px 0 2px 0;
  margin-top: 16px;
  z-index: 10;
}
@media (max-width: 1280px) {
  .modal-cols { grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; }
}
@media (max-width: 1100px) {
  .modal-cols { grid-template-columns: 1fr; }
}
.modal-back.above { z-index: 120; }

/* ----- Rich-Text-Titel ----- */
.richbar { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.richbar button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  min-width: 32px; padding: 4px 8px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.richbar button:hover { background: var(--rose); }
.richbar .hint { margin-left: 8px; }
.richtext {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  min-height: 44px; font-size: 15px; background: #fff; line-height: 1.4;
}
.richtext:focus { outline: 2px solid #e4b9c8; border-color: #e4b9c8; }
.richtext:empty::before { content: attr(data-placeholder); color: #a6aec2; }

/* ----- Firmenauswahl im Veranstaltungsdialog ----- */
.company-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.company-chosen {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: #f8fafd; font-size: 14px; min-width: 170px; min-height: 38px;
}
.company-chosen img { height: 26px; width: 26px; object-fit: contain; background: #fff; border-radius: 4px; }

.picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; max-height: 55vh; overflow-y: auto; padding: 2px;
}
.picker-card {
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 10px; cursor: pointer; text-align: center;
}
.picker-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.picker-card .pic {
  height: 64px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.picker-card .pic img { max-height: 100%; max-width: 100%; object-fit: contain; }
.picker-card .pic .noimg { font-size: 24px; font-weight: 650; color: var(--muted); }
.picker-card .nm { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout-section { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
input[type="range"] { width: 100%; }

/* ----- Toast ----- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
  max-width: 90vw;
}
#toast.error { background: var(--danger); }
#toast.ok { background: var(--ok); }

/* ----- Login (Marke: RaumSign) ----- */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(120% 120% at 50% 0%, #6e0023 0%, #3d0016 70%, #24000d 100%);
  padding: 20px;
}
.login-card { background: #fff; border-radius: 18px; padding: 38px 38px 30px; width: 100%; max-width: 400px; box-shadow: 0 24px 70px rgba(0,0,0,0.45); }
.brand-login { text-align: center; }
.brand-mark { display: flex; justify-content: center; margin: 6px 0 30px; }
.brand-logo-img { width: 230px; max-width: 82%; height: auto; }
.brand-login .field, .brand-login .login-error { text-align: left; }
.login-error { color: var(--danger); font-size: 13.5px; margin-bottom: 12px; min-height: 18px; }

/* ----- Firmenverzeichnis ----- */
.book-toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.book-toolbar input[type="text"] { max-width: 320px; }
.az-bar { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 16px; }
.az-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.az-btn:hover { border-color: var(--brand); color: var(--brand); }
.az-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.az-btn.empty { color: #c9c0c4; cursor: default; }
.az-btn.empty:hover { border-color: var(--line); color: #c9c0c4; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.book-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; }
.book-logo { height: 84px; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.book-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.book-logo .noimg { color: var(--muted); font-size: 26px; font-weight: 650; }
.book-name { font-weight: 650; font-size: 15px; }
.book-title { color: var(--muted); font-size: 13.5px; min-height: 17px; }
.book-actions { display: flex; gap: 8px; margin-top: auto; }
.logo-preview { height: 70px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-top: 8px; padding: 6px; }
.logo-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* ----- Live view ----- */
.live-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.live-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.live-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0c1220; }
.live-frame-wrap iframe {
  width: 1280px;
  height: 720px;
  border: 0;
  transform-origin: top left;
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}
.live-tile .cap { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 13.5px; }
.live-tile .cap b { font-size: 14px; }
.live-tile .cap a { color: var(--brand); text-decoration: none; font-size: 13px; }
.live-tile .cap a:hover { text-decoration: underline; }

/* ----- Dashboard: Hero ----- */
.dash-hero {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero-hi { font-size: 22px; font-weight: 650; }
.hero-date { color: #f2c3d2; font-size: 14px; margin-top: 3px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
}
.hero-btn:hover { background: #fff; color: var(--brand); }

/* ----- Dashboard: Kennzahlen mit Icons ----- */
.stat { display: flex; align-items: center; gap: 14px; border-top: none; }
.stat-ico {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--rose);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-ico svg { width: 24px; height: 24px; }
.stat .num.next { font-size: 14.5px; line-height: 1.35; color: var(--ink); font-weight: 600; }

/* ----- Dashboard: Heute-Liste ----- */
.today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 9px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.today-row:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.today-row.ended { opacity: 0.55; }
.today-logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  color: var(--muted);
  font-size: 18px;
  padding: 4px;
}
.today-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.today-text { flex: 1; min-width: 0; }
.today-title { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.today-where {
  flex: 0 0 auto;
  background: var(--rose);
  color: var(--brand);
  font-weight: 650;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 99px;
}
.today-badge { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; min-width: 92px; text-align: right; }
.today-badge.live { color: var(--ok); }
.today-badge.soon { color: var(--muted); }
.today-badge.done { color: var(--muted); }
.today-badge .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 5px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.today-empty { text-align: center; color: var(--muted); padding: 22px 0 18px 0; font-size: 14.5px; line-height: 1.7; }

/* ----- Week overview (dashboard) ----- */
.week-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.day-col { background: #faf6f7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; min-height: 90px; }
.day-col.today { background: var(--rose); border-color: var(--rose-line); }
.day-col h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.day-col.today h3 { color: var(--brand); }
.day-ev { font-size: 12.5px; padding: 5px 7px; background: var(--rose); border-left: 3px solid var(--brand); margin-bottom: 5px; }
.day-ev .rm { font-weight: 650; }
.day-ev .tm { color: var(--muted); }
.day-ev.blocker { background: #f0f0f2; border-left-color: #8b8f99; }
.day-empty { color: #b3bccf; font-size: 12.5px; }

/* ----- PDF-Import: Ablagefläche (Drag & Drop) ----- */
.dropzone {
  max-width: 520px;
  margin: 0 auto;
  border: 2px dashed var(--rose-line);
  border-radius: 16px;
  background: #fdf9fa;
  padding: 34px 22px;
  text-align: center;
  color: var(--brand);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: var(--rose);
}
.dropzone.drag { transform: scale(1.015); }
.dz-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 10px; }
.dz-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dz-file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--brand);
}
.dz-file b { color: var(--ink); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ----- Fortschrittsbalken (PDF-Import) ----- */
.pbar {
  height: 10px;
  background: var(--rose);
  border-radius: 99px;
  overflow: hidden;
  margin: 12px auto 0 auto;
  max-width: 480px;
}
.pbar-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 99px;
  transition: width 0.25s ease;
}

/* ----- Logo-Editor ----- */
.le-wrap {
  display: flex;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.le-wrap canvas { border-radius: 6px; cursor: grab; touch-action: none; max-width: 100%; }

/* ----- Einmal-Passwort (Reset) ----- */
.pw-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #faf6f7;
  border: 1px dashed var(--rose-line);
  border-radius: 10px;
  padding: 16px 14px;
}
.pw-box span {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  user-select: all;
}
.btn.ico-only { padding: 8px 10px; }
.btn.ico-only:hover { color: var(--brand); border-color: var(--brand); }

/* ----- Support-/Ticket-Dashboard (Admin) ----- */
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .dash-two { grid-template-columns: 1fr; } }
.stat-bar-row { margin-bottom: 11px; }
.stat-bar-row:last-child { margin-bottom: 0; }
.stat-bar-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.stat-bar-head b { color: var(--ink); }
.stat-bar-head span { color: var(--muted); }
.stat-bar-track { height: 8px; background: var(--rose); border-radius: 99px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--brand); border-radius: 99px; }
.dash-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ----- Support-Tickets ----- */
.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.sidebar nav a:hover .nav-badge,
.sidebar nav a.active .nav-badge { background: #fff; color: var(--brand); }
.ticket-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 9px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ticket-row:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.ticket-status {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 99px;
  min-width: 104px;
  text-align: center;
}
.ticket-status.open { background: var(--rose); color: var(--brand); }
.ticket-status.in_progress { background: #fdf3e0; color: #9a6a12; }
.ticket-status.done { background: #e8f4ec; color: var(--ok); }
.ticket-text { flex: 1; min-width: 0; }
.ticket-subject { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.ticket-has-answer { flex: 0 0 auto; color: var(--ok); font-size: 12.5px; font-weight: 600; }
.ticket-meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.ticket-body, .ticket-answer {
  background: #faf6f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  white-space: pre-line;
}
.ticket-answer { background: #e8f4ec; border-color: #cfe6d6; }

.hint { color: var(--muted); font-size: 13px; }

/* =====================================================================
   Mobil & Tablet
   ===================================================================== */

/* Tablet quer / kleine Notebooks */
@media (max-width: 1200px) {
  .sidebar { width: 200px; flex-basis: 200px; }
  .content { padding: 20px 18px 60px 18px; }
}

/* Tablet hoch und Smartphone: Navigation fährt über den Inhalt */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    flex-basis: 260px;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
  .sidebar.open { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .main { width: 100%; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px 14px 50px 14px; }

  /* Knöpfe oben rechts kompakter */
  .btn { padding: 8px 12px; }
  #syncBtn { padding: 8px 11px; }
  .user-btn span:not(.user-avatar) { display: none; }

  .card { padding: 15px 16px; margin-bottom: 16px; }
  .cards-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat .num { font-size: 23px; }
  .stat-ico { width: 38px; height: 38px; }

  /* Dialoge fast bildschirmfüllend */
  .modal-back { padding: 12px 10px; }
  .modal, .modal.wide, .modal:has(.modal-cols) { max-width: 100%; padding: 18px 16px; }
  .modal-cols { grid-template-columns: 1fr; gap: 14px; }
  .set-cols { grid-template-columns: 1fr; }
  .row2, .times-grid, .dash-two, .lp-grid, .lp-toggles { grid-template-columns: 1fr; }

  /* Tabellen und Kalender seitlich scrollbar statt gequetscht */
  .cal-wrap, .table-scroll { -webkit-overflow-scrolling: touch; }
  table.list { display: block; overflow-x: auto; white-space: nowrap; }

  .hero-actions { width: 100%; }
  .hero-btn { flex: 1; justify-content: center; }
  .dash-hero { padding: 18px 18px; }
  .hero-hi { font-size: 19px; }

  .week-list { grid-template-columns: 1fr 1fr; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 50vh; }
  .live-grid { grid-template-columns: 1fr; }

  /* Ticket-/Heute-Zeilen umbrechen statt überlaufen */
  .ticket-row, .today-row { flex-wrap: wrap; gap: 10px; }
  .today-where, .today-badge, .ticket-status { flex: 0 0 auto; }
  .today-text, .ticket-text { flex: 1 1 60%; min-width: 0; }
  .today-title, .ticket-subject { white-space: normal; }

  .dlg-tabs { overflow-x: auto; }
  .dlg-tab { padding: 9px 13px; font-size: 13.5px; white-space: nowrap; }
}

/* Smartphone hoch */
@media (max-width: 560px) {
  .cards-row { grid-template-columns: 1fr; }
  .week-list { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 15.5px; }
  #syncBtn span, #syncBtn { font-size: 0; padding: 8px 10px; }
  #syncBtn svg { width: 17px; height: 17px; }
  .book-toolbar input[type="text"] { max-width: 100%; }
  .cal-toolbar { gap: 6px; }
  .cal-toolbar .week-label { min-width: 100%; order: 10; font-size: 14.5px; }
  .az-btn { min-width: 23px; height: 23px; font-size: 11.5px; }
  .login-card { padding: 28px 22px 24px; }
  .brand-logo-img { width: 190px; }
  .modal .actions { flex-wrap: wrap; }
  .modal .actions .btn { flex: 1; justify-content: center; }
}
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--rose); color: var(--brand); font-weight: 600; }
.banner-warn {
  background: var(--rose); border: 1px solid var(--rose-line); color: var(--brand-dark);
  border-radius: 9px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px;
}
