/* Gemeinsames Grund-Design. Farben/Größen über CSS-Variablen anpassbar
   (die Hotelsoftware setzt sie aus den Gestaltungs-Einstellungen). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1d4ed8;
  --primary-text: #ffffff;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #15803d;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --tile-bg: #1d4ed8;
  --tile-fg: #ffffff;
  --tile-h: 130px;
  --font-scale: 1;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--font-scale)); }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .75rem; }
h1 + h2 { margin-top: 0; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
small.muted { display: block; font-weight: normal; margin-top: 2px; }

/* Layout mit Seitenleiste (Herstellerverwaltung, Einstellungen) */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--sidebar); color: var(--sidebar-text); padding: 18px 12px; flex-shrink: 0; }
.sidebar .brand { color: #fff; font-weight: 700; font-size: 1.05rem; padding: 6px 10px 16px; }
.sidebar a { display: block; color: var(--sidebar-text); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: .95rem; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: var(--primary); color: #fff; }
.sidebar .soon { opacity: .55; }
.sidebar .sep { height: 1px; background: rgba(255,255,255,.1); margin: 10px 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 22px; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.topbar .who { font-size: .9rem; color: var(--muted); }
.topbar .who strong { color: var(--text); }
.content { padding: 22px; max-width: 1200px; width: 100%; }
.btn.menu-toggle { display: none; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; display: none; }
  .sidebar.open { display: block; }
  .btn.menu-toggle { display: inline-block; }
  .content { padding: 14px; }
}

/* Karten, Tabellen, Formulare */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 520px; margin: 40px auto; }
.card h2:first-child { margin-top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .02em; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.dl { display: grid; grid-template-columns: 220px 1fr; gap: 6px 14px; font-size: .95rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 6px; } }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-weight: normal; background: #fff; color: var(--text); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 6px 0 0; }
input[type=color] { height: 42px; padding: 3px; }
label.check { font-weight: normal; display: flex; align-items: center; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.span2 { grid-column: span 2; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; font-size: .95rem; }
.btn:hover { background: #f1f5f9; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { filter: brightness(1.08); background: var(--primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.1); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.actions.end { justify-content: flex-end; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
form.inline { display: inline; }

.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-size: .95rem; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e5e7eb; color: #374151; white-space: nowrap; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; }
.stat .num { font-size: 1.9rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* Neun Hauptschaltflächen der Hotelsoftware */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: var(--tile-h); border-radius: 16px; background: var(--tile-bg); color: var(--tile-fg); text-decoration: none; font-size: 1.35rem; font-weight: 700; padding: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.08); transition: transform .08s, box-shadow .08s; text-align: center; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.tile .ico { font-size: 1.8rem; line-height: 1; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } .tile { min-height: calc(var(--tile-h) * .7); } }

/* Hotel-Kopfbereich */
.hotelbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hotelbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.hotelbar .brand img { max-height: var(--logo-h, 56px); max-width: 260px; width: auto; }
.hotelbar .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bell { position: relative; text-decoration: none; font-size: 1.3rem; }
.bell .count { position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 6px; font-weight: 700; }
.hotel-content { padding: 22px; max-width: 1200px; margin: 0 auto; width: 100%; }
.supportbar { background: #7c2d12; color: #fff; padding: 8px 22px; font-size: .9rem; text-align: center; }

/* Anmeldung / einfache Seiten */
body.plain { display: block; }
main.center { max-width: 460px; margin: 6vh auto; padding: 0 14px; }
main.install { max-width: 860px; margin: 30px auto; padding: 0 14px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; }
.login-card h1 { text-align: center; }
.login-card .logo { text-align: center; margin-bottom: 10px; }
.login-card .logo img { max-height: calc(var(--logo-h, 56px) * 1.6); max-width: 320px; width: auto; }
.plainlist { padding-left: 18px; }
.plainlist li { margin-bottom: 6px; }
.token { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; word-break: break-all; background: #f8fafc; border: 1px solid var(--border); padding: 10px; border-radius: 8px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.perm-group h3 { font-size: .95rem; margin: 0 0 6px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid #0002; }

/* 15.11.2026: Hintergrund etwas lebendiger (dezente Lichtverläufe über der Hintergrundfarbe) */
body { background-color: var(--bg); background-image:
    radial-gradient(1100px 600px at 100% -8%, rgba(29,78,216,.07), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(14,165,233,.06), transparent 60%);
  background-attachment: fixed; }

/* Uhrzeit und Abmelde-Countdown im Kopfbereich */
.kopf-zeit { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); font-size: .95rem; }
.kopf-countdown { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); background: #eef2f7; border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.kopf-countdown.warnung { color: #991b1b; background: #fee2e2; border-color: #fecaca; font-weight: 700; }

/* Demo-Knöpfe unten rechts (nur in der Demo-Version sichtbar) */
.demo-panel { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.demo-panel-titel { font-size: .72rem; font-weight: 800; color: #0f766e; text-align: center; letter-spacing: .05em; text-transform: uppercase; }
@media (max-width: 640px) { .demo-panel { left: 16px; right: 16px; flex-direction: row; justify-content: center; align-items: center; flex-wrap: wrap; } }

/* Vorschaukasten in "Oberfläche gestalten" */
.vorschau-box { background: #f1f5f9; border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; margin-top: 8px; }

/* ===================== Dark Mode & moderneres Erscheinungsbild (15.11.2026) ===================== */
:root { --ov-rgb: 248,250,252; }            /* Farbe der Abdunkelung über dem Hintergrundbild (Hell) */
html[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --text: #e6eaf2; --muted: #9aa6bb; --border: #26324a;
  --sidebar: #060b16; --ov-rgb: 6,10,20;
}
html[data-theme="dark"] code { background: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #0e1626; color: var(--text); border-color: #2b3a52; }
html[data-theme="dark"] .btn { background: #1b2740; border-color: #2b3a52; color: var(--text); }
html[data-theme="dark"] .btn:hover { background: #26344f; }
html[data-theme="dark"] .vorschau-box { background: #0e1626; }
html[data-theme="dark"] .badge { background: #273349; color: #cbd5e1; }
html[data-theme="dark"] .table th { background: #0e1626; }
html[data-theme="dark"] .alert-success { background: #0d2a20; border-color: #1c6b4d; color: #a7f3d0; }
html[data-theme="dark"] .alert-danger { background: #2a1113; border-color: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .alert-warning { background: #2a2110; border-color: #92650e; color: #fde68a; }
html[data-theme="dark"] .alert-info { background: #0f1f3a; border-color: #1e40af; color: #bfdbfe; }

/* Kopfleiste dunkel und modern (in beiden Modi) */
.hotelbar { background: linear-gradient(90deg, #0f172a 0%, #1e293b 55%, #334155 150%); border-bottom: 0; color: #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,.28); position: sticky; top: 0; z-index: 40; }
.hotelbar .brand { color: #fff; }
.hotelbar .bell { color: #e2e8f0; }
.hotelbar .right { align-items: center; }
.hotelbar .who { color: #cbd5e1; font-size: .92rem; }
.hotelbar .who strong { color: #fff; }
.who-link { text-decoration: none; color: #cbd5e1; padding: 5px 12px; border-radius: 999px; transition: background .15s, transform .12s; }
.who-link:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.hotelbar .right .btn { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.20); color: #eaf1fb; }
.hotelbar .right .btn:hover { background: rgba(255,255,255,.22); }

/* Uhr groß, Countdown kräftig */
.kopf-zeit { font-size: 1.7rem; font-weight: 800; color: #fff; letter-spacing: .02em; line-height: 1; }
.kopf-countdown { font-size: .95rem; font-weight: 800; color: #d1fae5; background: rgba(16,185,129,.22); border: 1px solid rgba(16,185,129,.55); padding: 4px 11px; }
.kopf-countdown.warnung { color: #fff; background: rgba(239,68,68,.34); border-color: rgba(239,68,68,.75); animation: dm-pulse 1s infinite; }
@keyframes dm-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* Hell/Dunkel-Umschalter (zwei Kästchen) */
.theme-switch { display: flex; gap: 5px; margin-right: 4px; }
.theme-switch button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.35); cursor: pointer; padding: 0; transition: transform .12s, box-shadow .12s; }
.theme-switch button:hover { transform: translateY(-1px); }
.theme-switch button[data-theme-set="light"] { background: #f8fafc; }
.theme-switch button[data-theme-set="dark"] { background: #0b1220; }
.theme-switch button.aktiv { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.4); }

/* Knöpfe & Kacheln lebendiger */
@keyframes wabbel { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-2.2deg); } 55% { transform: rotate(2deg); } 80% { transform: rotate(-1deg); } }
.btn { transition: transform .12s, filter .15s, background .15s, box-shadow .15s; }
.btn:hover { animation: wabbel .45s ease; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.btn-primary:hover { filter: brightness(1.12); }
.tile { transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-5px) scale(1.035) rotate(-.6deg); box-shadow: 0 14px 26px rgba(0,0,0,.2); }

/* "Startseite"-Knopf auffälliger: umlaufendes Licht (hell im Dark Mode, dunkel im hellen Modus) */
:root { --home-glow: #0f172a; }
html[data-theme="dark"] { --home-glow: #ffffff; }
.btn-home { position: relative; z-index: 0; font-weight: 700; }
.btn-home::before {
  content: ""; position: absolute; inset: -3px; border-radius: 11px; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 66%, var(--home-glow) 82%, transparent 92%);
  filter: blur(.5px); animation: home-spin 2.6s linear infinite; opacity: .85;
}
.btn-home:hover::before { animation-duration: 1.3s; opacity: 1; }
@keyframes home-spin { to { transform: rotate(360deg); } }

/* 16.11.2026: Kopfbereich bleibt beim Scrollen oben stehen – samt Hinweisbalken
   (Demo-Version, Wartungsmodus, Supportzugriff). */
.kopf-fest { position: sticky; top: 0; z-index: 40; }
.kopf-fest .hotelbar { position: static; }
