/* Q7Fakt Fernwartung – Verwaltung. Gestaltung nach Materio (references/materio-design) wie Q7Fakt selbst (public/assets/app.css):
   Inter, Violett #8c57ff, hellgraue Fläche, weiße Karten mit weichem Schatten, Seitenleiste mit Verlaufs-Hervorhebung, abgesetzte
   Kopfleiste, Hell/Dunkel nach Systemeinstellung. Keine externen Ressourcen (CSP); Schriften unter fonts/ (siehe fonts/HERKUNFT.md). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-v13-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-v13-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-v13-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-v13-latin-700.woff2") format("woff2"); }
@font-face { font-family: "remixicon"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/remixicon.woff2") format("woff2"); }

/* ------------------------------------------------------------------ Farben (hell / dunkel wie Q7Fakt) */
:root {
  --primary: #8c57ff; --primary-hover: #7e4ee6; --primary-soft: #f2ebff; --primary-line: #c9b0ff; --primary-grad: #c5aaff; --primary-shadow: rgba(140, 87, 255, .3);
  --bg: #f4f5fa; --card: #fff; --head: #f6f7fb; --hover: rgba(46, 38, 61, .06); --row-hover: #faf9fc;
  --text: #433c50; --body: #5c5667; --muted: #8a8694; --line: #e6e5e8; --input: #cfcdd4; --input-hover: #aeaab6; --field: #fff;
  --success: #56ca00; --success-text: #2e6d00; --success-soft: #e7f7da;
  --danger: #ff4c51; --danger-text: #b3171d; --danger-soft: #ffe7e8;
  --warning: #ffb400; --warning-text: #7a5200; --warning-soft: #fff4d6;
  --info: #16b1ff; --info-text: #075e8a; --info-soft: #dcf3ff;
  --shadow: 0 .25rem .625rem rgba(46, 38, 61, .14); --shadow-sm: 0 .125rem .375rem rgba(46, 38, 61, .1); --shadow-lg: 0 .5rem 1.5rem rgba(46, 38, 61, .2);
  --topbar: rgba(255, 255, 255, .95); --overlay: rgba(46, 38, 61, .5);
  --radius: .375rem; --radius-lg: .625rem; --side: 260px;
  color-scheme: light; font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary-soft: rgba(140, 87, 255, .18); --primary-line: rgba(140, 87, 255, .5);
    --bg: #28243d; --card: #312d4b; --head: #3a3555; --hover: rgba(231, 227, 252, .08); --row-hover: #36314f;
    --text: #e7e3fc; --body: #cfcbe4; --muted: #a39fb9; --line: #464160; --input: #5a5575; --input-hover: #7a7596; --field: #2c2843;
    --success-text: #9be35f; --success-soft: rgba(86, 202, 0, .16);
    --danger-text: #ff8a8d; --danger-soft: rgba(255, 76, 81, .16);
    --warning-text: #ffcf5c; --warning-soft: rgba(255, 180, 0, .16);
    --info-text: #7fd3ff; --info-soft: rgba(22, 177, 255, .16);
    --shadow: 0 .25rem .75rem rgba(19, 17, 32, .45); --shadow-sm: 0 .125rem .375rem rgba(19, 17, 32, .35); --shadow-lg: 0 .5rem 1.5rem rgba(19, 17, 32, .6);
    --topbar: rgba(49, 45, 75, .95); --overlay: rgba(19, 17, 32, .65);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--primary-line) var(--bg); }
body { margin: 0; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--body); line-height: 1.47; font-size: .9375rem; }
a { color: var(--primary); text-decoration: none; } a:hover { color: var(--primary-hover); text-decoration: underline; }
h1, h2, h3 { color: var(--text); font-weight: 500; }
h1 { font-size: 1.375rem; margin: 0 0 1.25rem; line-height: 1.3; }
h2 { font-size: 1.0625rem; margin: 2rem 0 .8rem; }
.karte > h2:first-child, .karte > form > h2:first-child { margin-top: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
code { font-size: .8125rem; background: var(--primary-soft); color: var(--primary); padding: .1rem .35rem; border-radius: .25rem; }
pre { background: var(--head); color: var(--text); padding: .8rem 1rem; border-radius: var(--radius); overflow-x: auto; }
.klein { font-size: .8125rem; color: var(--muted); }
p { margin: 0 0 1rem; }

/* ------------------------------------------------------------------ Symbole (Remix Icon) */
.ic { font-family: "remixicon" !important; font-style: normal; font-weight: 400; line-height: 1; display: inline-block; -webkit-font-smoothing: antialiased; }
.ic-freigaben::before { content: "\eed2"; } .ic-lizenzen::before { content: "\eed0"; } .ic-demos::before { content: "\eb27"; } .ic-kunden::before { content: "\eb27"; }
.ic-admins::before { content: "\f1ee"; } .ic-protokoll::before { content: "\ee17"; } .ic-person::before { content: "\f264"; }
.ic-abmelden::before { content: "\eeda"; } .ic-menu::before { content: "\ef3e"; } .ic-plus::before { content: "\ea13"; }

/* ------------------------------------------------------------------ Grundlayout: Seitenleiste + Inhalt (Materio „vertical menu“) */
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--bg); padding: 0 0 2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem 1rem; color: var(--text); font-weight: 600; font-size: 1.25rem; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand .unter { font-weight: 400; color: var(--muted); font-size: 1rem; }
.brand-logo { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; font-size: .8rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #c5aaff 0%, #8c57ff 100%); box-shadow: 0 2px 6px rgba(140, 87, 255, .35); }
.menu-header { display: flex; align-items: center; gap: .6rem; margin: 1.1rem 0 .35rem; padding: 0 1.25rem; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.menu-header::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.side nav a { display: flex; align-items: center; gap: .65rem; margin: .1rem 1rem .1rem 0; padding: .5rem 1rem .5rem 1.4rem; border-radius: 0 50rem 50rem 0;
  color: var(--text); font-size: .9375rem; }
.side nav a .ic { font-size: 1.3rem; color: var(--muted); width: 1.4rem; text-align: center; }
.side nav a:hover { background: var(--hover); text-decoration: none; }
.side nav a.aktiv, .side nav a.aktiv:hover { background: linear-gradient(270deg, var(--primary) 0%, var(--primary-grad) 100%); color: #fff; box-shadow: 0 2px 6px var(--primary-shadow); }
.side nav a.aktiv .ic { color: #fff; }
.seite { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; margin: 0 1.5rem; padding: .5rem 1rem; min-height: 3.5rem;
  background: var(--topbar); color: var(--text); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.top-titel { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-rechts { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.benutzer { display: inline-flex; align-items: center; gap: .55rem; padding: .2rem .7rem .2rem .2rem; border-radius: 50rem; color: var(--text); }
.benutzer:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
button.symbol { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; background: transparent; color: var(--text);
  font-size: 1.3rem; box-shadow: none; border: 0; }
button.symbol:hover { background: var(--hover); color: var(--text); box-shadow: none; }
.navtoggle { display: none; }
.hintergrund { display: none; }
main { flex: 1; width: 100%; padding: 1.5rem 1.5rem 3rem; min-width: 0; }   /* volle Browserbreite (Wunsch Anwender) */

/* ------------------------------------------------------------------ Karten, Tabellen */
.karte { background: var(--card); border-radius: var(--radius); padding: 1.25rem; margin: 0 0 1.5rem; box-shadow: var(--shadow); }
.schmal { max-width: 480px; }
details.karte > summary { cursor: pointer; color: var(--text); font-weight: 500; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.karte > summary::before { font-family: "remixicon"; content: "\ea13"; font-size: 1.2rem; color: var(--primary); }
details.karte > summary::-webkit-details-marker { display: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 1.5rem; }
.tabelle { margin: 0 0 1.5rem; overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); } .tabelle > table { margin: 0; box-shadow: none; }
th, td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--head); color: var(--text); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
thead tr:first-child th:first-child { border-top-left-radius: var(--radius); } thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
tbody tr:hover td { background: var(--row-hover); }
td strong { color: var(--text); font-weight: 500; }
tr.vergangen td { color: var(--muted); }
td.aktionen { white-space: nowrap; text-align: right; }
tr.bearbeiten-zeile > td { background: var(--head); padding-top: 0; } tr.bearbeiten-zeile:hover > td { background: var(--head); }
tr.bearbeiten-zeile .raster { margin-top: .9rem; }
table.lizenzen tbody tr:has(+ tr.bearbeiten-zeile:not([hidden])) > td { border-bottom-color: transparent; }

/* ------------------------------------------------------------------ Formulare und Knöpfe (Materio „form-floating-outline“ vereinfacht) */
label { display: block; margin: 0 0 1rem; color: var(--text); font-size: .8125rem; font-weight: 500; }
input, select { display: block; width: 100%; margin-top: .3rem; padding: .6rem .85rem; font: inherit; font-size: .9375rem; color: var(--text); background: var(--field);
  border: 1px solid var(--input); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: var(--input-hover); }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
input::placeholder { color: var(--muted); opacity: .8; }
button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1.25rem; font: inherit; font-size: .9375rem; font-weight: 500;
  color: #fff; background: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius); cursor: pointer; box-shadow: 0 2px 6px var(--primary-shadow);
  transition: background-color .15s, box-shadow .15s, color .15s; }
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 10px var(--primary-shadow); }
button.klein { padding: .3rem .75rem; font-size: .8125rem; color: var(--primary); background: transparent; border-color: var(--primary-line); box-shadow: none; }
button.klein:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
button.gefahr { color: var(--danger-text); border-color: rgba(255, 76, 81, .55); }
button.gefahr:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
button.link { padding: 0; color: var(--primary); background: none; border: 0; box-shadow: none; font-weight: 400; }
.inline { display: inline-flex; flex-wrap: nowrap; gap: .4rem; align-items: center; margin: .15rem .4rem .15rem 0; vertical-align: middle; }
.inline input, .inline select { width: auto; margin: 0; padding: .35rem .6rem; font-size: .875rem; }
.inline input.zahl { width: 6.5em; } .inline input[name=kunde] { width: 15rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 1rem; align-items: end; margin-top: 1rem; }
.raster > div { margin-bottom: 1rem; }
.suche { display: flex; gap: .5rem; align-items: center; margin: 0 0 1rem; max-width: 560px; } .suche input { margin: 0; }
.suche button.klein { padding: .55rem 1rem; }

/* ------------------------------------------------------------------ Meldungen, Kennzeichen */
.meldung { position: relative; padding: .8rem 1rem .8rem 2.8rem; margin: 0 0 1.25rem; border-radius: var(--radius); border-left: 4px solid; font-weight: 500; }
.meldung::before { font-family: "remixicon"; font-weight: 400; position: absolute; left: .9rem; top: .75rem; font-size: 1.2rem; line-height: 1; }
.meldung.ok { background: var(--success-soft); border-color: var(--success); color: var(--success-text); } .meldung.ok::before { content: "\eb81"; }
.meldung.fehler { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); } .meldung.fehler::before { content: "\eca1"; }
.gruen { color: var(--success-text); font-weight: 500; } .rot { color: var(--danger-text); font-weight: 500; }
.marke-ok, .marke-aus, .marke-info, .marke-warn, .marke-lila { white-space: nowrap; }
.marke-ok, .marke-aus { display: inline-block; padding: .1rem .55rem; border-radius: 50rem; font-size: .75rem; font-weight: 500; line-height: 1.5; }
.marke-ok { background: var(--success-soft); color: var(--success-text); } .marke-aus { background: var(--danger-soft); color: var(--danger-text); }
.marke-info, .marke-warn, .marke-lila { display: inline-block; padding: .1rem .55rem; border-radius: 50rem; font-size: .75rem; font-weight: 500; line-height: 1.5; }
.marke-info { background: var(--info-soft); color: var(--info-text); } .marke-warn { background: var(--warning-soft); color: var(--warning-text); }
.marke-lila { background: var(--primary-soft); color: var(--primary); }
code.waehlbar { user-select: all; white-space: nowrap; } code.gross { font-size: 1rem; padding: .2rem .5rem; }
.qr { display: block; margin: 1rem auto; max-width: 100%; height: auto; border-radius: var(--radius); }

/* ------------------------------------------------------------------ Anmeldung, Einrichtung (Materio „auth basic“) */
body.anmeldung { display: grid; place-items: center; min-height: 100vh; padding: 1rem;
  background: radial-gradient(circle at 15% 20%, rgba(140, 87, 255, .14) 0, transparent 40%), radial-gradient(circle at 85% 85%, rgba(22, 177, 255, .12) 0, transparent 40%), var(--bg); }
.anmeldebox { background: var(--card); border-radius: var(--radius-lg); padding: 2rem 2rem 1.6rem; width: min(460px, 100%); box-shadow: var(--shadow-lg); }
.anmeldebox .brand { justify-content: center; padding: 0 0 .8rem; font-size: 1.5rem; }
.anmeldebox h1 { text-align: center; font-size: 1.25rem; margin-bottom: 1.2rem; }
.anmeldebox .karte { box-shadow: none; padding: 0; margin: 0; max-width: none; }
.anmeldebox button:not(.klein):not(.link) { width: 100%; padding: .65rem 1rem; }

/* ------------------------------------------------------------------ kleinere Bildschirme: Seitenleiste als Schublade */
@media (max-width: 1000px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; background: var(--card); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.offen { transform: none; }
  .hintergrund.offen { display: block; position: fixed; inset: 0; z-index: 30; background: var(--overlay); }
  .navtoggle { display: inline-grid; }
  .top { margin: 0 .75rem; }
  main { padding: 1.25rem .75rem 2.5rem; }
  .benutzer .name { display: none; }
}

/* Gebundene Installationen unter den Freigaben */
details.bindungen { margin-top: 2rem; } details.bindungen .tabelle { margin: .8rem 0 0; }

/* Seitenaufteilung der Listen */
.blaettern { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: -.6rem 0 1.5rem; }
.blaettern .seiten { display: inline-flex; gap: .25rem; }
.blaettern .seiten a, .blaettern .seiten .aktuell { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .5rem; border-radius: 50rem;
  font-size: .875rem; text-decoration: none; color: var(--text); }
.blaettern .seiten a:hover { background: var(--hover); }
.blaettern .seiten .aktuell { background: var(--primary); color: #fff; box-shadow: 0 2px 6px var(--primary-shadow); }
.blaettern .je-seite a, .blaettern .je-seite .aktuell { margin-left: .35rem; } .blaettern .je-seite .aktuell { color: var(--primary); font-weight: 600; }
/* Kunde anlegen: Eingabe mit Endung .q7fakt.de */
.eingabe-mit-endung { display: flex; align-items: center; gap: .4rem; }
.eingabe-mit-endung input { flex: 1; }
