:root {
  /* Dunkelgrau im Stil von novum.at: Grautöne + ein kräftiges Grün als einziger Akzent */
  color-scheme: dark;
  --page: #262626;
  --surface: #303030;
  --surface-2: #3b3b3b;
  --header: #404040;          /* novum-Grau */
  --ink: #f1f1ef;
  --ink-2: #b9b7b4;
  --ink-3: #8a8786;
  --line: #474747;
  --axis: #5a5a5a;
  --accent: #b5d65a;          /* kräftiges Grün (aus novum-Salbeigrün abgeleitet) */
  --accent-ink: #262626;
  --accent-soft: #3d4a26;
  --bar: #a3cc4c;
  --bar-future: #55752a;
  --danger: #f08a7a;
  --ok: #a3cc4c;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 0 0 1px rgba(255,255,255,.06);
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --header-line: #4d4d4d;
  --brand-sep: rgba(255,255,255,.25);
  --hatch-stripe: rgba(255,255,255,.55);
  --tip-bg: #f2f5f2;
  --tip-ink: #111311;
  --line-strong: #5a5a5a;
  --warn-bg: #3a2c0b; --warn-ink: #f5c451; --warn-line: #6b5520;
  --err-bg: #4a2622; --err-ink: #f3a99c;
  --menu-shadow: 0 12px 32px rgba(0,0,0,.35);
  --sticky-shadow: 0 6px 16px -10px rgba(0,0,0,.6);
}

/* Helles Design: gleiche Akzentfarbe, aber dunkler abgestuft, damit Text auf Weiß lesbar bleibt */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #ececea;
  --header: #ffffff;
  --ink: #1f1f1f;
  --ink-2: #57554f;
  --ink-3: #75726d;
  --line: #deded9;
  --axis: #b3b1ac;
  --accent: #557a14;
  --accent-ink: #ffffff;
  --accent-soft: #eef5dd;
  --bar: #7fae2e;
  --bar-future: #b9d978;
  --danger: #b8382a;
  --ok: #5f8f1c;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.07);
  --header-line: #e2e2de;
  --brand-sep: rgba(0,0,0,.18);
  --hatch-stripe: rgba(255,255,255,.7);
  --tip-bg: #262626;
  --tip-ink: #f1f1ef;
  --line-strong: #c4c2bd;
  --warn-bg: #fbf0d2; --warn-ink: #7a5600; --warn-line: #e3c77a;
  --err-bg: #fbe3df; --err-ink: #9a2b1f;
  --menu-shadow: 0 12px 32px rgba(0,0,0,.12);
  --sticky-shadow: 0 6px 16px -10px rgba(0,0,0,.18);
}
:root[data-theme="light"] .logo,
:root[data-theme="light"] .login-logo { filter: invert(.86); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand .sep { width: 1px; height: 26px; background: var(--brand-sep); }
.topbar .spacer { flex: 1; }
.sync-state { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.err { background: var(--danger); }
.dot.run { background: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

.btn {
  border: 1.5px solid var(--ink-2); background: transparent; border-radius: 28px;
  padding: 7px 16px; cursor: pointer; white-space: nowrap; line-height: 1.2; font-weight: 700; letter-spacing: .02em;
  transition: background .15s, color .15s, border-color .15s;
}
.btn.outline { border-color: var(--accent); color: var(--accent); }
.btn.outline:hover { background: var(--accent); color: var(--accent-ink); }
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 550; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 400; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn:focus-visible, .chip:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Filter ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > .label { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.field .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
select, input[type="date"] {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 6px 8px; height: 34px;
}
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 11px; cursor: pointer; font-size: 14px; line-height: 1.2;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

details.multi { position: relative; }
details.multi > summary {
  list-style: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 6px 30px 6px 10px; height: 34px; min-width: 170px; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
}
details.multi > summary::-webkit-details-marker { display: none; }
details.multi > summary::after {
  content: ""; position: absolute; right: 12px; top: 13px;
  border: 4px solid transparent; border-top-color: var(--ink-2);
}
details.multi .menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  min-width: 260px; max-height: 340px; overflow: auto;
  background: var(--surface); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14), 0 0 0 1px var(--line);
}
.menu label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.menu label:hover { background: var(--surface-2); }
.menu .group { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 8px 2px; text-transform: uppercase; letter-spacing: .04em; }
.menu .actions { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- Inhalt ---------- */
main { padding: 22px 24px 48px; max-width: var(--content-max, 1400px); margin: 0 auto; }
.kpis { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.kpi .k-label { font-size: 13px; color: var(--ink-2); }
.kpi .k-value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.kpi.hero .k-value { font-size: 44px; line-height: 1.05; }
.kpi .k-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--bar); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.card h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card .sub { font-size: 13px; color: var(--ink-2); margin: 2px 0 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.past { background: var(--bar); }
.swatch.future { background: var(--bar-future); background-image: repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch-stripe) 3px 5px); }

/* Säulendiagramm */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .col { fill: var(--bar); }
.chart .col.future { fill: url(#hatch); }
.chart .col.current { fill: url(#hatch); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .col, .chart g.bucket:hover .col { filter: brightness(1.1); }
.chart .today { stroke: var(--ink-3); stroke-dasharray: 3 3; }

/* Raumtabelle */
table.rooms { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rooms th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.rooms th.r, table.rooms td.r { text-align: right; }
table.rooms td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.rooms tr:last-child td { border-bottom: none; }
table.rooms .room-name { font-weight: 550; }
table.rooms .room-meta { font-size: 12px; color: var(--ink-2); }
.barcell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.barcell .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.barcell .fill { height: 100%; background: var(--bar); border-radius: 4px; }
.barcell .pct { width: 48px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Heatmaps */
.heat { display: grid; gap: 2px; font-size: 11px; }
.heat .hcell {
  height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; font-size: 11px; cursor: default; position: relative;
}
.heat .rlabel { display: flex; align-items: center; padding-right: 8px; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .clabel { text-align: center; color: var(--ink-2); font-size: 11px; padding-top: 4px; white-space: nowrap; }
.heat-scroll { overflow-x: auto; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.scale .ramp { display: flex; height: 10px; width: 160px; border-radius: 3px; overflow: hidden; }
.scale .ramp span { flex: 1; }

.empty { padding: 40px 0; text-align: center; color: var(--ink-2); }

/* Tooltip */
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-ink); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; line-height: 1.35; max-width: 260px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.tip strong { display: block; margin-bottom: 2px; }

/* Dialog (Admin) */
dialog {
  border: none; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 17px; }
.dlg-body { padding: 16px 22px 22px; max-height: 70vh; overflow: auto; }
.dlg-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dlg-body td, .dlg-body th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.dlg-body th { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.sync-list { display: grid; gap: 6px; margin-bottom: 18px; font-size: 14px; }
.sync-list div { display: flex; gap: 8px; align-items: center; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(380px, 100%); }
.login h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
.login p { margin: 0 0 20px; color: var(--ink-2); }
.login label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
.login input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface); }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }
.login .error { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar, .filters, main { padding-left: 16px; padding-right: 16px; }
  .topbar { gap: 4px; padding-top: 10px; padding-bottom: 10px; }
  .topbar .btn { padding: 6px 8px; font-size: 14px; }
  .brand { font-size: 16px; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi.hero { grid-column: 1 / -1; }
  .card.kpi { padding: 12px; }
  .kpi .k-value { font-size: 22px; }
  .kpi .k-sub { font-size: 12px; }
  .card { padding: 14px; }
  .sync-state .txt { display: none; }
  .filters { gap: 10px 14px; }
  .barcell { min-width: 0; gap: 6px; }
  .barcell .track { min-width: 30px; }
  .hide-sm { display: none; }
  table.rooms td, table.rooms th { padding-left: 4px; padding-right: 4px; }
  details.multi > summary { min-width: 0; max-width: 100%; }
  .field { flex: 1 1 100%; }
}
@media print {
  .topbar .btn, .filters .btn { display: none; }
  body { background: #fff; }
}
.dlg-body h3 { margin: 22px 0 10px; }
.dlg-body h3:first-child { margin-top: 0; }
.heat .cyear { font-size: 10px; color: var(--ink-3); }
.login-logo { height: 44px; width: auto; display: block; margin-bottom: 18px; }
.login .btn { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.login .btn:hover { filter: brightness(1.05); background: var(--accent); }
@media (max-width: 600px) {
  .brand { gap: 10px; font-size: 15px; }
  .brand .logo { height: 26px; }
  .brand .sep { height: 20px; }
}
.sync-state { white-space: nowrap; }
@media (max-width: 900px) {
  .sync-state .txt { display: none; }
}

/* Admin: Akkordeon je Location */
.dlg-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dlg-toolbar .spacer { flex: 1; }
.acc-list { display: grid; gap: 8px; margin-top: 12px; }
details.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.acc[open] { border-color: var(--line-strong); }
details.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--radius);
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin-right: 2px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg); transition: transform .15s;
}
details.acc[open] > summary::before { transform: rotate(45deg); }
details.acc > summary:hover { background: var(--surface-2); }
details.acc > summary .spacer { flex: 1; }
.acc-name { font-size: 16px; }
.acc-meta { font-size: 13px; color: var(--ink-2); }
.acc-body { padding: 0 14px 12px; }
.acc-sync { margin-bottom: 6px; }
.dot.none { background: var(--ink-3); }
.badge.err { background: var(--err-bg); color: var(--err-ink); }
.dlg-body { background: var(--page); }

/* Breite Monitore: Kopf- und Filterleiste füllen den Hintergrund ganz aus,
   ihr Inhalt richtet sich aber an der Inhaltsbreite (1400px) aus */
:root { --content-max: 1400px; }
@media (min-width: 601px) {
  .topbar, .filters {
    padding-left: max(24px, calc((100% - var(--content-max)) / 2 + 24px));
    padding-right: max(24px, calc((100% - var(--content-max)) / 2 + 24px));
  }
}

/* Admin: Locations anlegen und bearbeiten */
dialog.narrow { width: min(520px, calc(100vw - 32px)); }
.dlg-body.form label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 14px 0 5px; }
.dlg-body.form label:first-child { margin-top: 0; }
.dlg-body.form input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface); }
.dlg-body.form .hint { font-size: 13px; color: var(--ink-3); margin: 5px 0 0; }
.form-msg { min-height: 20px; margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.notice { font-size: 14px; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.notice.err { background: var(--err-bg); color: var(--err-ink); }
.notice code, .dlg-body code { font-size: 13px; }
.loc-settings { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 2px 0 10px; }
.loc-settings a { color: var(--ink-2); }
.loc-settings .spacer { flex: 1; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.inactive-list { margin-top: 18px; font-size: 14px; }
.inactive-list h3 { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.inactive-list div { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.inactive-list .spacer { flex: 1; }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { background: var(--err-bg); color: var(--err-ink); }

/* Zurücksetzen + Exportieren: rechts in der Filterleiste */
.filter-actions { margin-left: auto; flex-direction: row; align-items: center; gap: 6px; }

/* Filterleiste bleibt beim Scrollen oben (nicht auf schmalen Bildschirmen, dort wäre sie zu hoch) */
@media (min-width: 768px) {
  .filters { position: sticky; top: var(--topbar-h, 58px); z-index: 19; box-shadow: var(--sticky-shadow); }
}
details.multi > summary { min-width: 130px; }
details.multi#rooms > summary { min-width: 150px; }
@media (min-width: 601px) { .filters { column-gap: 16px; } }

/* Export-Dialog */
.choice-group { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.choice-group legend, .label-sm { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.choice { display: flex !important; gap: 12px; align-items: flex-start; margin: 0 !important; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dlg-body.form .choice input { width: auto; flex: none; margin-top: 4px; accent-color: var(--accent); }
.choice > span { flex: 1; min-width: 0; }
.choice strong { display: block; color: var(--ink); font-size: 15px; }
.choice .hint { display: block; margin: 2px 0 0; }
.check { display: flex !important; gap: 8px; align-items: center; color: var(--ink) !important; font-weight: 400 !important; font-size: 14px !important; margin: 4px 0 0 !important; cursor: pointer; }
.check input { width: auto !important; accent-color: var(--accent); }
.dlg-body.form select { width: 100%; }
.export-scope { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.export-scope dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.export-scope dt { color: var(--ink-3); }
.export-scope dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .filter-actions { margin-left: 0; flex: 1 1 100%; justify-content: flex-end; }
}

/* Profilmenü in der Kopfzeile */
details.profile { position: relative; }
details.profile > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--ink-2);
}
details.profile > summary::-webkit-details-marker { display: none; }
details.profile > summary:hover, details.profile[open] > summary { background: var(--surface-2); color: var(--ink); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.profile-name { font-size: 14px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 250px;
  background: var(--surface); border-radius: 12px; padding: 6px;
  box-shadow: var(--menu-shadow), 0 0 0 1px var(--line);
}
.profile-head { display: grid; gap: 2px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-head span { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.profile-head .badge { justify-self: start; margin-top: 4px; }
.profile-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--ink);
}
.profile-menu button:hover, .profile-menu button:focus-visible { background: var(--surface-2); outline: none; }
.profile-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (max-width: 900px) { .profile-name { display: none; } details.profile > summary { padding-right: 4px; } }

/* Profilmenü: Design-Umschalter */
.theme-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px 6px 10px; }
.theme-label { font-size: 14px; color: var(--ink); }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--surface-2); gap: 2px; }
.profile-menu .seg button {
  display: inline-block; width: auto; padding: 4px 10px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
}
.profile-menu .seg button:hover { background: transparent; color: var(--ink); }
.profile-menu .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.profile-menu .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.2); }

/* Benutzerverwaltung */
.users-table td { vertical-align: middle; }
.users-table .u-name { font-weight: 700; }
.users-table .u-mail { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.users-table .u-actions { white-space: nowrap; text-align: right; }
.badge.admin { background: var(--accent-soft); color: var(--accent); }
.loc-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 12px; margin-top: 6px; }
.loc-checks[hidden] { display: none; }
.pw-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0 10px; }
.pw-box code { flex: 1; font-size: 18px; letter-spacing: .04em; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 600px) { .users-table .hide-sm { display: none; } }

/* Zugänge und Zuordnung */
dialog.wide-form { width: min(600px, calc(100vw - 32px)); }
.inline-input { display: block; margin-top: 8px; width: 100%; }
.choice .inline-input { font-size: 14px; }
.conn-section { margin-top: 26px; }
.conn-section h3, .unassigned-title { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
.conn-list { display: grid; gap: 8px; margin-top: 10px; }
.conn-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; display: grid; gap: 6px; }
.conn-card .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-card .row1 .spacer { flex: 1; }
.conn-card .meta { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.conn-card .meta a { color: var(--ink-2); }
.conn-card .err-msg { font-size: 13px; color: var(--danger); }
details.acc.unassigned { border-color: var(--warn-line); }
.res-table select { max-width: 100%; }
.res-table .conn-tag { display: block; font-size: 12px; color: var(--ink-3); }
.rule-list { display: grid; gap: 8px; margin: 8px 0; }
.rule { display: grid; grid-template-columns: 130px 1fr 130px auto; gap: 6px; align-items: center; }
.rule input, .rule select { width: 100% !important; }
.rules-head { margin-top: 16px; }
.loc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 2px 0 8px; }
@media (max-width: 600px) { .rule { grid-template-columns: 1fr 1fr; } }

/* Exportieren: Hauptaktion der Filterleiste, gefüllt und mit Symbol */
.btn-export { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; padding: 7px 18px 7px 14px; }
.btn-export .ico { width: 16px; height: 16px; flex: none; }
/* Helleres Grün für Exportieren, in beiden Designs mit dunkler Schrift */
/* Dunkel: Grün der Verlaufsbalken, beim Hover das Grün des Profil-Avatars */
.btn-export { --export-bg: var(--bar); --export-hover: var(--accent); background: var(--export-bg); border-color: var(--export-bg); color: #1f1f1f; }
:root[data-theme="light"] .btn-export { --export-bg: #a8d14f; --export-hover: #b9db66; }
.btn-export:hover { background: var(--export-hover); border-color: var(--export-hover); color: #1f1f1f; filter: none; }
