/* zelocliq – Oberfläche (v0.8.0)
   Zwei Aussehen pro Benutzer wählbar: A = hell und luftig, B = dunkle Seitenleiste.
   Akzentfarbe (blau, petrol, violett, orange) und hell/dunkel/automatisch über Attribute am <html>-Element:
   data-layout="a|b", data-accent="…", data-theme="hell|dunkel|auto". Keine Inline-Styles (Content-Security-Policy). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.f837d382a885.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.42b95430773b.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.75fb76ec3559.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.3714175d15f3.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-ext-400-normal.9159859e7aa8.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-ext-500-normal.656e8d21838c.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-ext-600-normal.8f9364515dfc.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-ext-700-normal.39b692b06219.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* --- Hell (Standard) --- */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F2F4F7;
  --ink: #101828;
  --muted: #5D6B82;
  --line: #E4E7EC;
  --ok: #067647;
  --warn: #B54708;
  --crit: #B42318;
  --focus: #F79009;
  --tape: #F3E7A9;
  --tape-edge: #D8C770;
  --cat-ort: #7A5C2E;
  --cat-hardware: #0E7C86;
  --cat-logisch: #5B3CC4;
  --vis-10: #067647;
  --vis-20: #2449A8;
  --vis-30: #5B3CC4;
  --vis-40: #B42318;
  --accent: #2449A8; --accent-ink: #FFFFFF; --accent-soft: #EAF0FC;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: none;
  --pad: 1.25rem;
  --cell: .7rem;
  --side-bg: #FFFFFF;
  --side-ink: #344054;
  --side-muted: #5D6B82;
  --side-hover: #F2F4F7;
  --side-active: var(--accent-soft);
  --side-active-ink: var(--accent);
  --side-line: #E4E7EC;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", "Consolas", "DejaVu Sans Mono", monospace;
  color-scheme: light;
}
:root[data-accent="petrol"] { --accent: #0E7C86; --accent-soft: #E3F4F5; }
:root[data-accent="violett"] { --accent: #5B3CC4; --accent-soft: #EFEBFB; }
:root[data-accent="orange"] { --accent: #C2410C; --accent-soft: #FDEEE6; }

/* --- Aussehen B: dunkle Seitenleiste, kompakter, Karten mit Schatten --- */
:root[data-layout="b"] {
  --bg: #EEF1F5;
  --line: #DDE2EA;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 41, .07), 0 1px 1px rgba(15, 23, 41, .04);
  --pad: 1rem;
  --cell: .55rem;
  --side-bg: #0F1729;
  --side-ink: #C8D0DE;
  --side-muted: #8A96AD;
  --side-hover: #18233A;
  --side-active: #1E2A44;
  --side-active-ink: #FFFFFF;
  --side-line: #1E2A44;
}

/* --- Dunkel (fest oder automatisch nach Systemeinstellung) --- */
:root[data-theme="dunkel"] {
  --bg: #0E1420;
  --surface: #151D2B;
  --surface-2: #1B2536;
  --ink: #E6EBF2;
  --muted: #98A4B6;
  --line: #273246;
  --ok: #4FC48B;
  --warn: #F5B544;
  --crit: #F97066;
  --tape: #3B3622;
  --tape-edge: #5C5330;
  --cat-ort: #D2AD72;
  --cat-hardware: #5FC4CC;
  --cat-logisch: #A99BF0;
  --vis-10: #4FC48B;
  --vis-20: #7FA3F5;
  --vis-30: #A99BF0;
  --vis-40: #F97066;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --side-bg: #0B111B;
  --side-ink: #C8D0DE;
  --side-muted: #8A96AD;
  --side-hover: #18233A;
  --side-active: #1E2A44;
  --side-active-ink: #FFFFFF;
  --side-line: #1E2A44;
  color-scheme: dark;
  --accent: #7FA3F5; --accent-ink: #0B1220; --accent-soft: #1C2A4A;
}
:root[data-theme="dunkel"][data-accent="petrol"] { --accent: #4FC2CB; --accent-soft: #123538; }
:root[data-theme="dunkel"][data-accent="violett"] { --accent: #A99BF0; --accent-soft: #2A2350; }
:root[data-theme="dunkel"][data-accent="orange"] { --accent: #F7A063; --accent-soft: #432414; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0E1420;
    --surface: #151D2B;
    --surface-2: #1B2536;
    --ink: #E6EBF2;
    --muted: #98A4B6;
    --line: #273246;
    --ok: #4FC48B;
    --warn: #F5B544;
    --crit: #F97066;
    --tape: #3B3622;
    --tape-edge: #5C5330;
    --cat-ort: #D2AD72;
    --cat-hardware: #5FC4CC;
    --cat-logisch: #A99BF0;
    --vis-10: #4FC48B;
    --vis-20: #7FA3F5;
    --vis-30: #A99BF0;
    --vis-40: #F97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --side-bg: #0B111B;
    --side-ink: #C8D0DE;
    --side-muted: #8A96AD;
    --side-hover: #18233A;
    --side-active: #1E2A44;
    --side-active-ink: #FFFFFF;
    --side-line: #1E2A44;
    color-scheme: dark;
    --accent: #7FA3F5; --accent-ink: #0B1220; --accent-soft: #1C2A4A;
  }
  :root[data-theme="auto"][data-accent="petrol"] { --accent: #4FC2CB; --accent-soft: #123538; }
  :root[data-theme="auto"][data-accent="violett"] { --accent: #A99BF0; --accent-soft: #2A2350; }
  :root[data-theme="auto"][data-accent="orange"] { --accent: #F7A063; --accent-soft: #432414; }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.mono, code, pre, kbd { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side-bg); color: var(--side-ink);
  border-right: 1px solid var(--side-line);
  padding: 1.25rem .85rem 1rem;
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .45rem; text-decoration: none; color: var(--side-ink); }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-logo svg { width: 17px; height: 17px; stroke: #FFFFFF; }
.brand-mark { font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; color: var(--ink); }
:root[data-layout="b"] .brand-mark { color: #FFFFFF; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--side-muted); padding: .9rem .6rem .3rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; border-radius: 8px;
  color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: .93rem;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav a .nav-label { flex: 1; min-width: 0; }
.nav a:hover { background: var(--side-hover); }
.nav a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink); font-weight: 600; }
.nav a .badge { border: 0; font-weight: 700; font-size: .72rem; padding: .05rem .5rem; }
.nav a .badge.warn { background: #FEF0C7; color: #93370D; }
:root[data-layout="b"] .nav a .badge.warn { background: #F79009; color: #0F1729; }
.sidebar-foot { margin-top: auto; font-size: .82rem; color: var(--side-muted); padding: .9rem .5rem 0; border-top: 1px solid var(--side-line); display: grid; gap: .3rem; }
.sidebar-foot .who { display: flex; align-items: center; gap: .6rem; color: var(--side-ink); font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--side-hover); color: var(--side-ink); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sidebar-foot a, .sidebar-foot .linkbtn { color: var(--side-muted); }
.sidebar-foot form { display: inline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .85rem 2rem; background: transparent;
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px);
}
:root[data-layout="b"] .topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: .7rem 1.75rem; }
.topbar .spacer { flex: 1; }
.search { position: relative; flex: 1 1 320px; max-width: 560px; }
.search input { width: 100%; padding: .6rem .8rem .6rem 2.3rem; border-radius: var(--radius); background: var(--surface); }
:root[data-layout="b"] .search input { background: var(--surface-2); }
.search::before {
  content: ""; position: absolute; left: .85rem; top: 50%; width: .7rem; height: .7rem;
  border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-60%);
}
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(10, 20, 40, .16); max-height: 70vh; overflow-y: auto; z-index: 20;
}
.search-results:empty { display: none; }
.search-group { padding: .5rem .85rem; border-top: 1px solid var(--line); }
.search-group:first-child { border-top: 0; }
.search-group h4 { margin: .2rem 0; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.search-group a { display: block; padding: .25rem 0; text-decoration: none; }
.content { padding: .75rem 2rem 2.5rem; max-width: 1360px; width: 100%; }
:root[data-layout="b"] .content { padding-top: 1.5rem; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Flächen */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.stat a { text-decoration: none; color: inherit; }
.empty { color: var(--muted); padding: .5rem 0; }

/* Ortspfad im Stil von Beschriftungsband */
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-bottom: .5rem; }
.tape {
  display: inline-block; padding: .05rem .5rem; font-size: .85rem;
  background: var(--tape); border: 1px solid var(--tape-edge); border-radius: 2px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
a.tape:hover { border-color: var(--ink); }
.trail .sep { color: var(--muted); font-size: .8rem; }

/* Kennzeichnungen */
.badge {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem;
  border: 1px solid currentColor; line-height: 1.5; white-space: nowrap;
}
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.crit { color: var(--crit); }
.badge.muted { color: var(--muted); }
.vis { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; white-space: nowrap; }
.vis::before { content: ""; width: .55rem; height: .55rem; border-radius: 2px; background: currentColor; }
.vis-10 { color: var(--vis-10); }
.vis-20 { color: var(--vis-20); }
.vis-30 { color: var(--vis-30); }
.vis-40 { color: var(--vis-40); }
.type { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.type::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--cat-hardware); }
.type.cat-ort::before { background: var(--cat-ort); border-radius: 1px; }
.type.cat-logisch::before { background: var(--cat-logisch); transform: rotate(45deg); border-radius: 1px; }
.status-geplant { color: var(--muted); }
.status-wartung { color: var(--warn); }
.status-ausser_betrieb, .status-archiviert { color: var(--muted); text-decoration: line-through; }
.due { color: var(--crit); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; font-weight: 600; color: var(--muted); }
tbody tr:hover { background: var(--surface-2); }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
dl.props { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: .35rem 1.25rem; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; word-break: break-word; }

/* Baum */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: .8rem; padding-left: .9rem; border-left: 1px solid var(--line); }
.tree li { padding: .15rem 0; }
.tree .node { display: inline-flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }

/* Formulare */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .6rem; max-width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; }
textarea.editor { min-height: 28rem; line-height: 1.55; tab-size: 4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; }
.field input:not([type="checkbox"]), .field select { width: 100%; }
.field.check { flex-direction: row; align-items: center; gap: .5rem; }
.field.check label { font-weight: 500; order: 2; }
.field .help { font-size: .82rem; color: var(--muted); }
.field .error, .errorlist { color: var(--crit); font-size: .85rem; margin: 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--crit); }
.field ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .2rem; }
.field ul:not(.errorlist) label { font-weight: 400; display: flex; gap: .4rem; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .35rem; font-weight: 600; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters .field { min-width: 150px; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }

/* Schaltflächen */
.btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: .45rem .9rem; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }
.btn.small { padding: .2rem .55rem; font-size: .85rem; font-weight: 500; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

/* Meldungen */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.messages li { padding: .6rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--accent); }
.messages .error { border-left-color: var(--crit); }
.messages .warning { border-left-color: var(--warn); }
.notice { padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); margin-bottom: 1rem; }
.notice.crit { border-left-color: var(--crit); }

/* Doku */
.doc { max-width: 78ch; }
.doc h1 { font-size: 1.5rem; margin-top: 1.5rem; }
.doc h1:first-child { margin-top: 0; }
.doc h2 { font-size: 1.2rem; margin-top: 1.5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.doc h3 { margin-top: 1.2rem; }
.doc table { margin: .75rem 0; }
.doc pre { background: var(--surface-2); padding: .75rem; border-radius: var(--radius); overflow-x: auto; }
.doc code { background: var(--surface-2); padding: .05rem .3rem; border-radius: 3px; }
.doc pre code { background: none; padding: 0; }
.doc blockquote { margin: .75rem 0; padding: .2rem 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.diff { font-family: var(--mono); font-size: .88rem; white-space: pre-wrap; margin: 0; }
.diff div { padding: 0 .5rem; }
.diff .add { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.diff .del { background: color-mix(in srgb, var(--crit) 16%, transparent); }
.diff .hunk { color: var(--muted); margin-top: .5rem; }
.editor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: .75rem 1rem; min-height: 28rem; overflow-y: auto; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .brand { padding: 0; margin-bottom: 1.25rem; }
.auth-box .panel { padding: 1.5rem; }
.auth-box .field input:not([type="checkbox"]) { width: 100%; }
.qr { background: #fff; padding: .5rem; border-radius: var(--radius); display: inline-block; }

.pagination { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .sidebar-foot { margin-top: 0; }
  .grid-2, .grid-3, .grid-main, .form-grid, .editor-wrap { grid-template-columns: 1fr; }
  .topbar { position: static; padding: .6rem 1rem; }
  .content { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .sidebar, .topbar, .actions, .form-actions, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}

/* Hilfsklassen (keine Inline-Styles wegen Content-Security-Policy) */
.mt { margin-top: 1rem; }
.narrow { max-width: 640px; }
.medium { max-width: 920px; }
.spacer { flex: 1; }
hr.sep-line { border: 0; border-top: 1px solid var(--line); margin: .6rem 0; }
.type-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .3rem .75rem; }
.choice { display: flex; align-items: center; gap: .45rem; padding: .25rem 0; cursor: pointer; }

/* Tickets */
.prio { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; white-space: nowrap; }
.prio::before { content: ""; width: .5rem; height: .9rem; border-radius: 1px; background: var(--muted); }
.prio-kritisch { color: var(--crit); font-weight: 600; }
.prio-kritisch::before { background: var(--crit); }
.prio-hoch { color: var(--warn); }
.prio-hoch::before { background: var(--warn); }
.prio-normal::before { background: var(--accent); }
.prio-niedrig { color: var(--muted); }
.sla { font-size: .85rem; white-space: nowrap; }
.sla-breached { color: var(--crit); font-weight: 600; }
.sla-warn { color: var(--warn); font-weight: 600; }
.sla-paused, .sla-done { color: var(--muted); }
.ticket-no { font-family: var(--mono); font-size: .88em; color: var(--muted); white-space: nowrap; }
.views { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .75rem; }
.views a { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; background: var(--surface); }
.views a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.meta-line { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; }

.timeline { display: flex; flex-direction: column; gap: .75rem; }
.entry { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.entry-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .45rem .8rem; border-bottom: 1px solid var(--line); font-size: .87rem; }
.entry-body { padding: .7rem .8rem; white-space: pre-wrap; word-break: break-word; }
.entry.in { border-left: 4px solid var(--vis-20); }
.entry.out { border-left: 4px solid var(--ok); }
.entry.note { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.entry.system, .entry.time { border: 0; background: none; }
.entry.system .entry-body, .entry.time .entry-body { padding: 0 .8rem; color: var(--muted); font-size: .87rem; white-space: normal; }
.entry.time .entry-body::before { content: "◷ "; }
.entry .attachments { padding: 0 .8rem .6rem; display: flex; flex-wrap: wrap; gap: .5rem; font-size: .87rem; }
.compose { display: grid; gap: .6rem; }
.compose textarea { min-height: 8rem; }
.related-item { padding: .35rem 0; border-top: 1px solid var(--line); }
.related-item:first-child { border-top: 0; }
.reasons { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.reason { font-size: .78rem; padding: 0 .4rem; border-radius: 3px; background: var(--accent-soft); }
.side-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }
.timer { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--crit) 12%, transparent); color: var(--crit); font-weight: 600; font-size: .88rem; }
.mail-preview { white-space: pre-wrap; font-size: .9rem; max-height: 22rem; overflow-y: auto; background: var(--surface-2); padding: .6rem .8rem; border-radius: var(--radius); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 1rem 0 .3rem; }
.day-head h3 { margin: 0; }
.weekend { opacity: .75; }
.bar { height: .5rem; background: var(--accent-soft); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--accent); }
details.inline > summary { cursor: pointer; color: var(--accent); }
details.inline[open] > summary { margin-bottom: .6rem; }

/* Balkenbreiten ohne Inline-Styles */
.bar .w0 { width: 0%; }
.bar .w1 { width: 1%; }
.bar .w2 { width: 2%; }
.bar .w3 { width: 3%; }
.bar .w4 { width: 4%; }
.bar .w5 { width: 5%; }
.bar .w6 { width: 6%; }
.bar .w7 { width: 7%; }
.bar .w8 { width: 8%; }
.bar .w9 { width: 9%; }
.bar .w10 { width: 10%; }
.bar .w11 { width: 11%; }
.bar .w12 { width: 12%; }
.bar .w13 { width: 13%; }
.bar .w14 { width: 14%; }
.bar .w15 { width: 15%; }
.bar .w16 { width: 16%; }
.bar .w17 { width: 17%; }
.bar .w18 { width: 18%; }
.bar .w19 { width: 19%; }
.bar .w20 { width: 20%; }
.bar .w21 { width: 21%; }
.bar .w22 { width: 22%; }
.bar .w23 { width: 23%; }
.bar .w24 { width: 24%; }
.bar .w25 { width: 25%; }
.bar .w26 { width: 26%; }
.bar .w27 { width: 27%; }
.bar .w28 { width: 28%; }
.bar .w29 { width: 29%; }
.bar .w30 { width: 30%; }
.bar .w31 { width: 31%; }
.bar .w32 { width: 32%; }
.bar .w33 { width: 33%; }
.bar .w34 { width: 34%; }
.bar .w35 { width: 35%; }
.bar .w36 { width: 36%; }
.bar .w37 { width: 37%; }
.bar .w38 { width: 38%; }
.bar .w39 { width: 39%; }
.bar .w40 { width: 40%; }
.bar .w41 { width: 41%; }
.bar .w42 { width: 42%; }
.bar .w43 { width: 43%; }
.bar .w44 { width: 44%; }
.bar .w45 { width: 45%; }
.bar .w46 { width: 46%; }
.bar .w47 { width: 47%; }
.bar .w48 { width: 48%; }
.bar .w49 { width: 49%; }
.bar .w50 { width: 50%; }
.bar .w51 { width: 51%; }
.bar .w52 { width: 52%; }
.bar .w53 { width: 53%; }
.bar .w54 { width: 54%; }
.bar .w55 { width: 55%; }
.bar .w56 { width: 56%; }
.bar .w57 { width: 57%; }
.bar .w58 { width: 58%; }
.bar .w59 { width: 59%; }
.bar .w60 { width: 60%; }
.bar .w61 { width: 61%; }
.bar .w62 { width: 62%; }
.bar .w63 { width: 63%; }
.bar .w64 { width: 64%; }
.bar .w65 { width: 65%; }
.bar .w66 { width: 66%; }
.bar .w67 { width: 67%; }
.bar .w68 { width: 68%; }
.bar .w69 { width: 69%; }
.bar .w70 { width: 70%; }
.bar .w71 { width: 71%; }
.bar .w72 { width: 72%; }
.bar .w73 { width: 73%; }
.bar .w74 { width: 74%; }
.bar .w75 { width: 75%; }
.bar .w76 { width: 76%; }
.bar .w77 { width: 77%; }
.bar .w78 { width: 78%; }
.bar .w79 { width: 79%; }
.bar .w80 { width: 80%; }
.bar .w81 { width: 81%; }
.bar .w82 { width: 82%; }
.bar .w83 { width: 83%; }
.bar .w84 { width: 84%; }
.bar .w85 { width: 85%; }
.bar .w86 { width: 86%; }
.bar .w87 { width: 87%; }
.bar .w88 { width: 88%; }
.bar .w89 { width: 89%; }
.bar .w90 { width: 90%; }
.bar .w91 { width: 91%; }
.bar .w92 { width: 92%; }
.bar .w93 { width: 93%; }
.bar .w94 { width: 94%; }
.bar .w95 { width: 95%; }
.bar .w96 { width: 96%; }
.bar .w97 { width: 97%; }
.bar .w98 { width: 98%; }
.bar .w99 { width: 99%; }
.bar .w100 { width: 100%; }

/* Paket 4: Projekte und Changes */
.panel h3 { font-size: .95rem; margin: 1rem 0 .35rem; }
.state { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); white-space: nowrap; }
.state-genehmigung { color: var(--warn); border-color: currentColor; }
.state-genehmigt, .state-geplant { color: var(--accent); border-color: currentColor; }
.state-umsetzung { color: var(--accent); border-color: currentColor; font-weight: 600; }
.state-abgeschlossen { color: var(--ok); border-color: currentColor; }
.state-fehlgeschlagen, .state-abgelehnt { color: var(--crit); border-color: currentColor; }
.state-entwurf { color: var(--muted); }
.gantt { display: block; max-width: none; font-size: 12px; }
.gantt text { fill: var(--ink); }
.gantt .gantt-tick { fill: var(--muted); font-size: 11px; }
.gantt .gantt-ms-label { font-style: italic; }
.gantt-grid { stroke: var(--line); stroke-width: 1; }
.gantt-today { stroke: var(--crit); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt-bar { fill: var(--muted); opacity: .55; }
.gantt-bar.gantt-in_arbeit { fill: var(--accent); opacity: 1; }
.gantt-bar.gantt-erledigt { fill: var(--ok); opacity: .8; }
.gantt-ms { fill: var(--warn); }
.gantt-ms.gantt-ms-erreicht { fill: var(--ok); }
table.budget td:last-child { min-width: 140px; }
.bar.bar-warn span { background: var(--warn); }
.bar.bar-crit span { background: var(--crit); }
.quota .bar { margin: .25rem 0; }
.kind-dep { display: contents; }
.kind-dep[hidden] { display: none; }
p.kind-dep { display: block; }
fieldset.checks { border: 0; padding: 0; margin: 0; }
fieldset.checks legend { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .25rem 1rem; }
.check-item { display: flex; align-items: center; gap: .4rem; font-weight: normal; }
.field[hidden] { display: none; }

/* Nächste Aktion: grün = später, gelb = in den nächsten 2 Stunden, rot = fällig/überfällig */
.due-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.due-ok { background: #E3F4EA; color: #05603A; border-color: #A6DDBD; }
.due-soon { background: #FEF3C7; color: #8A4B05; border-color: #F5D27A; }
.due-over { background: #FEE4E2; color: #A01A12; border-color: #F7B4AE; }
.due-none { color: var(--muted); }
.due-ok, .due-soon, .due-over { }
:root[data-theme="dunkel"] .due-ok { background: #0E3B26; color: #8EE0B2; border-color: #1C6B45; }
:root[data-theme="dunkel"] .due-soon { background: #43320A; color: #F9D77E; border-color: #7A5A12; }
:root[data-theme="dunkel"] .due-over { background: #4A1512; color: #FDA29B; border-color: #8A2A22; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .due-ok { background: #0E3B26; color: #8EE0B2; border-color: #1C6B45; }
  :root[data-theme="auto"] .due-soon { background: #43320A; color: #F9D77E; border-color: #7A5A12; }
  :root[data-theme="auto"] .due-over { background: #4A1512; color: #FDA29B; border-color: #8A2A22; }
}

tr.attention td:first-child a { font-weight: 700; }
.activity-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 999px; background: var(--accent); margin-right: .35rem; vertical-align: middle; }
.activity-text { color: var(--accent); font-weight: 600; }
.next-action { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.next-action .field { margin: 0; }
.quick-dates { display: flex; flex-wrap: wrap; gap: .35rem; }
.assign-select { min-width: 14rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Ressourcen-Explorer */
.explorer { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .explorer { grid-template-columns: 1fr; } }
.xside { max-height: 75vh; overflow: auto; padding: .75rem; }
.xsearch input { width: 100%; margin-bottom: .6rem; }
.xhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .8rem 0 .3rem; }
.xtree, .xtree ul, .xlist { list-style: none; margin: 0; padding: 0; }
.xtree ul { padding-left: 1rem; border-left: 1px solid var(--line); margin-left: .55rem; }
.xnode { display: flex; align-items: baseline; gap: .4rem; padding: .3rem .5rem; border-radius: 6px; text-decoration: none; color: inherit; }
.xnode a { color: inherit; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xnode:hover { background: var(--accent-soft); }
.xnode.active { background: var(--accent-soft); font-weight: 600; }
.xnode.xroot { margin-top: .4rem; font-weight: 600; }
.xmeta { font-size: .75rem; color: var(--muted); white-space: nowrap; margin-left: auto; }
.xnode.drop-ok { outline: 2px dashed var(--accent); background: var(--accent-soft); }
tr[draggable="true"] { cursor: grab; }
tr.dragging, .xnode a.dragging { opacity: .5; }
.xactions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.xactions select { max-width: 22rem; }
.xsep { width: 1px; height: 1.5rem; background: var(--line); margin: 0 .25rem; }
.xcrumbs { margin-bottom: .35rem; }
.xlicense { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.wide-select { width: 100%; }
a.stat-link { display: block; text-decoration: none; color: inherit; }
a.stat-link:hover { border-color: var(--accent); }


/* ===== Moderne Bauteile (v0.8.0) – überschreiben die Grundformen oben ===== */
html { font-size: 15px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.005em; }
.page-head { margin-bottom: 1.4rem; align-items: center; }
.page-head h1 { margin-bottom: .2rem; }

.panel { border-radius: var(--radius-lg); padding: var(--pad); box-shadow: var(--shadow); }
:root[data-layout="b"] .panel { border-color: transparent; }
.panel + .panel { margin-top: 1.1rem; }
.grid { gap: 1.1rem; }

.btn { padding: .55rem 1rem; border-radius: var(--radius); font-weight: 600; transition: filter .15s, background .15s, border-color .15s; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--muted); background: var(--surface-2); }
.btn.danger { background: var(--surface); }
.btn.small { padding: .3rem .65rem; border-radius: calc(var(--radius) - 2px); }

input, select, textarea { border-radius: var(--radius); padding: .55rem .7rem; border-color: var(--line); }
:root[data-theme="dunkel"] input, :root[data-theme="dunkel"] select, :root[data-theme="dunkel"] textarea { background: var(--surface-2); }
fieldset { border-radius: var(--radius-lg); background: var(--surface); }

th, td { padding: var(--cell) .75rem; border-bottom-color: var(--line); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .045em; color: var(--muted); font-weight: 600; }
:root[data-layout="b"] thead th { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.panel.table-wrap { padding: 0; overflow-x: auto; overflow-y: hidden; position: relative; }
.panel.table-wrap table { margin: 0; }
.panel.table-wrap th:first-child, .panel.table-wrap td:first-child { padding-left: 1.25rem; }
.panel.table-wrap th:last-child, .panel.table-wrap td:last-child { padding-right: 1.25rem; }
.panel.table-wrap .pagination { padding: 0 1.25rem 1rem; }

.badge { border: 0; font-weight: 600; font-size: .75rem; padding: .15rem .6rem; }
.badge.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.crit { background: color-mix(in srgb, var(--crit) 13%, transparent); }
.badge.muted { background: var(--surface-2); }

.views { gap: .4rem; margin-bottom: 1rem; }
.views a { padding: .4rem .85rem; font-weight: 500; border-color: var(--line); background: var(--surface); }
.views a .badge { margin-left: .2rem; }
:root[data-layout="b"] .views a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.messages li, .notice { border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 4px; box-shadow: var(--shadow); }

.stat { gap: .25rem; }
.stat strong { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.tape { border-radius: 4px; }
.bar { height: .5rem; }
.entry { border-radius: var(--radius); }

/* Kopfzeile: Benutzer, Schnellaktionen */
.top-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.greeting { color: var(--muted); font-size: .9rem; }

/* Darstellung wählen */
.appearance { display: grid; gap: 1.25rem; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.choice-card { border: 2px solid var(--line); border-radius: var(--radius-lg); padding: .9rem; display: grid; gap: .6rem; cursor: pointer; background: var(--surface); }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice-card input { accent-color: var(--accent); }
.choice-card .title { font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.mini { display: grid; grid-template-columns: 26% 1fr; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.mini .side { background: #FFFFFF; border-right: 1px solid #E4E7EC; }
.mini .body { background: #F6F7F9; padding: 8px; display: grid; gap: 6px; align-content: start; }
.mini .body i { display: block; height: 10px; border-radius: 3px; background: #FFFFFF; border: 1px solid #E4E7EC; }
.mini .body i:first-child { width: 55%; background: #D0D5DD; border: 0; }
.mini.b .side { background: #0F1729; border-right: 0; }
.mini.b .body { background: #EEF1F5; }
.mini.b .body i { border: 0; box-shadow: 0 1px 2px rgba(15, 23, 41, .12); }
.mini.dark .side { background: #0B111B; border-color: #1E2A44; }
.mini.dark .body { background: #0E1420; }
.mini.dark .body i { background: #151D2B; border-color: #273246; }
.swatches { display: flex; gap: .75rem; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem .45rem .5rem; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); }
.swatch:has(input:checked) { border-color: var(--ink); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch .dot { width: 22px; height: 22px; border-radius: 999px; }
.dot-blau { background: #2449A8; } .dot-petrol { background: #0E7C86; } .dot-violett { background: #5B3CC4; } .dot-orange { background: #C2410C; }

@media (max-width: 900px) {
  .topbar, :root[data-layout="b"] .topbar { padding: .6rem 1rem; }
  .content, :root[data-layout="b"] .content { padding: 1rem; }
  .nav a { padding: .4rem .55rem; }
  .nav a svg { display: none; }
}
@media print {
  :root { --bg: #FFFFFF; --shadow: none; }
}
:root[data-layout="a"] .nav-group.soft { display: none; }
:root[data-layout="a"] .nav-group.soft + a { margin-top: 0; }
.nav a .badge.crit { background: var(--crit); color: #FFFFFF; }
.portal-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-top .brand { padding: 0; }
.auth-box .brand { color: var(--ink); }
.auth-box .panel { box-shadow: 0 8px 30px rgba(16, 24, 40, .08); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-tickets .stat a { display: flex; flex-direction: column; gap: .35rem; }
.dash-tickets .stat .muted { font-size: .85rem; font-weight: 500; }
.grid > .panel + .panel, .grid > .panel { margin-top: 0; }
.stat a { display: flex; flex-direction: column; gap: .35rem; }
.stat a .muted, .stat a span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.stat a strong { order: 2; }
.explorer > .panel, .explorer > .panel + .panel { margin-top: 0; }
.next-panel { margin-bottom: 1.1rem; }
.appearance > .panel, .appearance > .panel + .panel { margin-top: 0; }
tr.group-row td { background: var(--surface-2); padding-top: .6rem; }
form.inline { display: inline; }
.origin { font-size: .78rem; color: var(--accent); font-weight: 500; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
select.assign-inline { padding: .3rem .5rem; font-size: .85rem; max-width: 12rem; background: transparent; border-color: transparent; }
select.assign-inline:hover, select.assign-inline:focus { border-color: var(--line); background: var(--surface); }
select.assign-inline.unassigned { color: var(--muted); border: 1px dashed var(--line); }
input.narrow { width: 6rem; }
.panel.table-wrap > .panel-head { padding: var(--pad) 1.25rem .25rem; }
.pad-x { padding-left: 1.25rem; padding-right: 1.25rem; }
.exception-form { display: grid; gap: .4rem; margin-top: .4rem; max-width: 32rem; }
.check-item { display: flex; gap: .4rem; align-items: center; font-weight: 400; }
.copyright { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 1.5rem; }
.nav a.nav-locked { opacity: .45; }
.nav a.nav-locked:hover { opacity: .7; }
.nav a.nav-locked svg:last-child { width: 14px; height: 14px; margin-left: auto; }
.export-panel { margin-bottom: 1rem; padding: .6rem var(--pad); }
.export-panel summary { cursor: pointer; font-weight: 600; }
.export-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: .6rem; }
.export-form .field { margin: 0; }
.rule-form { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; } .rule-form input { width: 14rem; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link.active { color: var(--accent); }

/* --- Handy: Menü als Schublade, schlanke Kopfzeile, Unterreiter zum Wischen --------------------- */
.nav-toggle, .nav-close, .mobile-brand, .nav-backdrop { display: none; }
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(84vw, 320px); height: 100%; overflow-y: auto;
    border-right: 1px solid var(--line); border-bottom: 0; transform: translateX(-105%); transition: transform .22s ease;
    padding-top: calc(env(safe-area-inset-top, 0px) + .75rem); box-shadow: 0 0 40px rgba(15, 23, 42, .25);
  }
  .sidebar.open { transform: none; }
  .nav { flex-direction: column; flex-wrap: nowrap; }
  .nav-group { display: block; }
  .nav a { padding: .6rem .7rem; }
  .nav a svg { display: inline-block; }
  .sidebar-foot { margin-top: 1rem; }
  .nav-close {
    display: inline-flex; position: absolute; top: calc(env(safe-area-inset-top, 0px) + .7rem); right: .7rem;
    width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; border: 0; border-radius: 10px;
    background: transparent; color: inherit; cursor: pointer;
  }
  .nav-close svg { width: 1.25rem; height: 1.25rem; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .45); }
  body.nav-open { overflow: hidden; }

  .topbar, :root[data-layout="b"] .topbar {
    position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: calc(env(safe-area-inset-top, 0px) + .5rem) .75rem .6rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .nav-toggle {
    display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border: 1px solid var(--line);
    border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .nav-toggle svg { width: 1.3rem; height: 1.3rem; }
  .mobile-brand { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font-weight: 700; }
  .mobile-brand .brand-logo { width: 1.9rem; height: 1.9rem; }
  .mobile-brand .brand-mark, :root[data-layout="b"] .mobile-brand .brand-mark { color: var(--ink); }
  .topbar .spacer { flex: 1; }
  .topbar .search { order: 10; flex: 1 1 100%; max-width: none; }
  .hide-mobile { display: none !important; }

  /* Unterreiter (z. B. SIEM): eine Zeile, seitlich wischen */
  .views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .15rem; max-width: 100%; }
  .views::-webkit-scrollbar { display: none; }
  .views > a { flex: none; white-space: nowrap; }
}
.setup-row td { padding-top: 0; }
.setup-cmds { display: grid; gap: .8rem; padding: .5rem 0; }
.copy-line { display: flex; gap: .5rem; align-items: flex-start; margin: .25rem 0; }
.copy-line code { flex: 1; font-size: .75rem; word-break: break-all; background: var(--surface-2, #f3f5f8); padding: .4rem .5rem; border-radius: 6px; }

/* Lange Zeichenketten ohne Leerzeichen (Fingerabdrücke, Schlüssel, Befehle, Pfade) umbrechen statt die Seite zu verbreitern */
.mono, code, td, .detail, .notice, p { overflow-wrap: break-word; }
table { table-layout: auto; }
/* Rasterspalten dürfen schmaler als ihr längster Inhalt werden; Befehlsblöcke scrollen in sich */
.grid > *, .grid-main > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
pre { max-width: 100%; overflow-x: auto; }

/* --- Monitoring-Dashboard ------------------------------------------------------------------- */
.mon-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.mon-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; display: grid; gap: .2rem; }
.mon-kpi span { font-size: .78rem; color: var(--muted); }
.mon-kpi strong { font-size: 1.9rem; line-height: 1; }
.mon-kpi small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.mon-kpi.is-ok strong { color: var(--ok); }
.mon-kpi.is-red strong, .mon-kpi.is-new strong { color: var(--crit); }
.mon-kpi.is-new { animation: itc-blink 1.2s ease-in-out infinite; }
.mon-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.mon-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.mon-head h2, .mon-side h2 { font-size: 1rem; margin: 0 0 .5rem; }
.alarm { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--crit); border-radius: 12px; padding: .75rem .9rem; margin-bottom: .6rem; }
.alarm-main { min-width: 0; flex: 1; }
.alarm-title { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.alarm-where { font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.alarm-msg { margin: .35rem 0 0; font-size: .85rem; overflow-wrap: break-word; }
.alarm-meta { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.alarm-meta .ack { color: var(--ink); }
.alarm-log { margin-top: .3rem; font-size: .8rem; }
.alarm-log ol { margin: .3rem 0 0 1rem; padding: 0; }
.alarm.is-new { animation: itc-blink 1.2s ease-in-out infinite; }
.badge-new { background: var(--crit); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 999px; }
.ack-btn { background: var(--crit); border-color: var(--crit); color: #fff; white-space: nowrap; }
.mon-allgood { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok); border-radius: 12px; padding: 1.2rem; color: var(--ok); font-weight: 600; }
.mon-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.mon-tile { display: grid; gap: .1rem; padding: .6rem .7rem; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--ok); }
.mon-tile span { font-size: .8rem; }
.mon-tile small { font-size: .72rem; color: var(--muted); }
.mon-tile.is-red { border-top-color: var(--crit); }
.mon-tile.is-red span { color: var(--crit); font-weight: 600; }
.mon-tile.is-new { border-top-color: var(--crit); animation: itc-blink 1.2s ease-in-out infinite; }
.mon-tile.is-new span { color: var(--crit); font-weight: 700; }
.mon-tile.is-selected { outline: 2px solid var(--accent); }
.mon-recent { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.mon-recent li { display: flex; gap: .5rem; align-items: flex-start; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; margin-top: .35rem; flex: none; }
.dot.ok { background: var(--ok); }
@keyframes itc-blink { 0%, 100% { background: var(--surface); } 50% { background: color-mix(in srgb, var(--crit) 22%, var(--surface)); } }
@media (prefers-reduced-motion: reduce) {
  .alarm.is-new, .mon-tile.is-new, .mon-kpi.is-new { animation: none; outline: 3px solid var(--crit); }
}
@media (max-width: 1100px) { .mon-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .mon-grid { grid-template-columns: 1fr; } .mon-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Monitoring: kompakte Alarmzeilen und Fenster */
.alarm-list { display: grid; gap: .45rem; }
.alarm-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--crit); border-radius: 12px; padding: .6rem .85rem; }
.alarm-row:hover, .alarm-row:focus-visible { border-color: var(--crit); outline: none; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.alarm-row.is-new { animation: itc-blink 1.2s ease-in-out infinite; }
.alarm-row-main { display: grid; min-width: 0; }
.alarm-row-main strong { overflow-wrap: break-word; }
.alarm-row-sub { font-size: .82rem; color: var(--muted); }
.alarm-row-side { display: flex; align-items: center; gap: .5rem; flex: none; }
.alarm-age { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.ack-mark { color: var(--muted); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .alarm-row.is-new { animation: none; outline: 3px solid var(--crit); } }
.alarm-dialog { width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(15, 23, 42, .35); overflow: auto; }
.alarm-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.ad-loading { padding: 2rem; color: var(--muted); }
.ad-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-top: 6px solid var(--crit);
  background: color-mix(in srgb, var(--crit) 8%, var(--surface)); }
.ad-head.is-new { animation: itc-blink 1.2s ease-in-out infinite; }
.ad-head.is-ok { border-top-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.ad-head h2 { margin: .3rem 0 .1rem; font-size: 1.2rem; overflow-wrap: break-word; }
.ad-head-text { min-width: 0; }
.ad-sub { color: var(--muted); font-size: .9rem; }
.ad-chip { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff;
  background: var(--crit); padding: .12rem .5rem; border-radius: 999px; }
.ad-head.is-ok .ad-chip { background: var(--ok); }
.ad-close { border: 0; background: transparent; color: var(--ink); font-size: 1.1rem; cursor: pointer; width: 2.2rem; height: 2.2rem;
  border-radius: 10px; flex: none; }
.ad-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ad-body { padding: 1rem 1.25rem 1.25rem; }
.ad-message { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); border-radius: 10px; padding: .7rem .85rem; margin-bottom: .9rem;
  overflow-wrap: break-word; }
.ad-facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
.ad-facts dt { color: var(--muted); }
.ad-facts dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
.ad-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.ad-body h3 { font-size: .95rem; margin: 0 0 .5rem; }
.ad-timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; border-left: 2px solid var(--line); display: grid; gap: .7rem; }
.ad-timeline li { position: relative; display: flex; gap: .6rem; padding-left: .6rem; font-size: .88rem; }
.tl-dot { position: absolute; left: -.85rem; top: .3rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--muted);
  border: 2px solid var(--surface); }
.tl-neu .tl-dot, .tl-wieder_rot .tl-dot, .tl-geaendert .tl-dot { background: var(--crit); }
.tl-quittiert .tl-dot { background: var(--accent); }
.tl-behoben .tl-dot { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .ad-head.is-new { animation: none; } }
@media (max-width: 600px) { .ad-facts { grid-template-columns: 1fr; } .ad-facts dt { margin-top: .3rem; } }
#nav-mon-badge { margin-left: auto; display: inline-flex; }
#nav-mon-badge .badge { margin-left: 0; }

/* Monitoring: Verbindung verloren – blinkt immer (auch quittiert), steht oben; Fehlertext direkt in der Liste */
@keyframes itc-blink-strong { 0%, 100% { background: var(--surface); } 50% { background: color-mix(in srgb, var(--crit) 38%, var(--surface)); } }
@keyframes itc-blink-banner { 0%, 100% { background: var(--crit); } 50% { background: color-mix(in srgb, var(--crit) 55%, #000); } }
.mon-offline { background: var(--crit); color: #fff; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; }
.mon-offline.is-blinking { animation: itc-blink-banner 1s ease-in-out infinite; }   /* nur solange nicht quittiert */
.mon-offline-title { display: block; font-size: 1.1rem; margin-bottom: .3rem; }
.mon-offline ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.mon-offline li { cursor: pointer; }
.mon-offline li:hover span:first-child, .mon-offline li:focus-visible span:first-child { text-decoration: underline; }
.mon-offline li:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.mon-offline-age { opacity: .85; font-size: .85rem; }
/* Verbindung verloren: quittiert = ruhig, aber kräftig rot; nicht quittiert = blinkt */
.alarm-row.is-offline { border-left-width: 10px; animation: none; background: color-mix(in srgb, var(--crit) 14%, var(--surface)); }
.alarm-row.is-offline.is-new { animation: itc-blink-strong 1s ease-in-out infinite; }
.mon-kpi.is-offline { border-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.mon-kpi.is-offline.is-blinking, .mon-tile.is-offline.is-blinking { animation: itc-blink-strong 1s ease-in-out infinite; }
.mon-tile.is-offline { border-top-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.tile-offline { color: var(--crit) !important; font-weight: 700; }
.badge-offline { justify-self: start; background: var(--crit); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; margin-bottom: .15rem; }
.alarm-row-msg { font-size: .84rem; color: var(--ink); margin-top: .15rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mon-hidden { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .1rem .55rem;
  font-size: .78rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.mon-view { margin-bottom: 1rem; }
.mon-view summary { cursor: pointer; font-weight: 600; }
.mon-view-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .25rem .75rem; margin: .6rem 0; }
.mon-view-kinds .count { color: var(--muted); font-size: .8rem; }
.mon-view-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ad-message ul { margin: 0; padding-left: 1.1rem; }
.ad-message li + li { margin-top: .2rem; }
.ad-what { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .3rem; font-weight: 700; }

/* Kundenportal (v0.14): Navigation, Überblick, Listen */
.portal-top .brand { text-decoration: none; color: var(--ink); }
.portal-nav { display: flex; gap: .35rem; flex-wrap: wrap; padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-nav a { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .92rem; font-weight: 500; }
.portal-nav a:hover { background: var(--accent-soft); }
.portal-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.portal-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.portal-kpi { display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem;
  text-decoration: none; color: var(--ink); }
a.portal-kpi:hover { border-color: var(--accent); }
.portal-kpi span { font-size: .8rem; color: var(--muted); }
.portal-kpi strong { font-size: 1.9rem; line-height: 1; }
.portal-kpi small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.portal-kpi.is-ok strong { color: var(--ok); }
.portal-kpi.is-red strong { color: var(--crit); }
.portal-kpi.is-offline { animation: itc-blink-strong 1s ease-in-out infinite; border-color: var(--crit); }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.portal-grid > .panel { margin: 0; }
.portal-item { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.portal-item:first-of-type { border-top: 0; }
.portal-item > div, .portal-item > a, .portal-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.portal-item.is-offline { background: color-mix(in srgb, var(--crit) 10%, var(--surface)); padding-left: .5rem; padding-right: .5rem; border-radius: 8px; }
.portal-block { display: block; }
.portal-good { color: var(--ok); font-weight: 600; margin: .25rem 0; }
.portal-clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .15rem; }
.portal-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.portal-facts dl, .portal-dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
.portal-facts dt, .portal-dl dt { color: var(--muted); }
.portal-facts dd, .portal-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.portal-sep { width: 1px; background: var(--line); margin: 0 .3rem; }
.portal-area-col { text-align: center; font-size: .85rem; }
.portal-form { display: grid; gap: .9rem; max-width: 760px; }
.dot.crit { background: var(--crit); }
.portal-item .dot { display: inline-block; vertical-align: middle; margin-top: 0; }
@media (max-width: 800px) {
  .portal-detail { grid-template-columns: 1fr; }
  .portal-user { display: none; }
  .portal-nav { padding: .5rem 1rem; overflow-x: auto; flex-wrap: nowrap; }
  .portal-nav a { white-space: nowrap; }
  .portal-dl, .portal-facts dl { grid-template-columns: 1fr; }
  .portal-dl dt, .portal-facts dt { margin-top: .3rem; }
}

/* Kundenportal v0.15: Branding, Feinschliff, Handy */
.field.check { flex-wrap: wrap; }
.field.check .help { order: 3; flex-basis: 100%; margin-left: 1.6rem; }
.portal-brand { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; }
.portal-logo { display: block; max-height: 40px; max-width: 220px; width: auto; height: auto; }
.portal-brand-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-brand-sub { font-size: .8rem; color: var(--muted); padding-left: .6rem; border-left: 1px solid var(--line); white-space: nowrap; }
.portal-top { gap: .9rem; min-height: 64px; }
.portal-who { display: grid; text-align: right; line-height: 1.25; }
.portal-who strong { font-size: .92rem; }
.portal-footer { display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 1.5rem 1rem 2rem; font-size: .85rem;
  color: var(--muted); border-top: 1px solid var(--line); margin-top: 1rem; }
.portal-footer strong { color: var(--ink); }
.portal-contact { display: inline-flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: center; }
.portal-contact a { text-decoration: none; }
.portal-contact a:hover { text-decoration: underline; }
.portal-powered { font-size: .75rem; }
.portal-help .portal-contact { justify-content: flex-start; flex-direction: column; gap: .3rem; font-size: .95rem; }
.portal .content a:not(.btn) { text-decoration: none; }
.portal .content a:not(.btn):hover { text-decoration: underline; }
.portal-item a { font-weight: 500; }
.portal-search { min-width: min(340px, 100%); }
.portal .filters { align-items: center; }
.panel.table-wrap > .table-title { margin: 0; padding: 1rem 1.25rem .35rem; font-size: 1rem; }
.portal-res-table { table-layout: fixed; }
.portal-res-table th:nth-child(1) { width: 34%; }
.portal-res-table th:nth-child(2) { width: 16%; }
.portal-res-table th:nth-child(3) { width: 26%; }
.portal-res-table th:nth-child(4) { width: 12%; }
.portal-res-table th:nth-child(5) { width: 12%; }
.portal-quota { max-width: 520px; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2, #F5F7FA); margin: .25rem 0 .9rem; }
.portal-pick { border: 0; padding: 0; margin: 0; }
.portal-pick legend { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.portal-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1rem; max-height: 220px; overflow: auto;
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; }
.portal-pick-list .check-item { align-items: flex-start; }
.portal-help { border-top: 3px solid var(--accent); }
.badge-offline + strong { margin-left: .2rem; }
/* Anmeldeseite im Portal */
.auth-portal .auth-box { max-width: 420px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1rem; }
.auth-brand .portal-logo { max-height: 56px; max-width: 260px; }
.auth-welcome { text-align: center; color: var(--muted); margin: -.25rem 0 1rem; }
.auth-contact { display: grid; gap: .3rem; justify-items: center; text-align: center; margin-top: 1rem; font-size: .88rem; }
.auth-contact .portal-contact { justify-content: center; }
/* Admin: Branding */
.branding-logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.branding-logo-preview { display: inline-flex; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #FFFFFF; }
.branding-logo-preview img { max-height: 40px; max-width: 220px; display: block; }
.branding-color { display: flex; align-items: center; gap: .8rem; }
.branding-color input[type="color"] { width: 3rem; height: 2.2rem; padding: .1rem; }
.branding-form .label, .field > .label { font-weight: 600; font-size: .9rem; }
@media (max-width: 700px) {
  .portal-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .portal-kpi { padding: .65rem .8rem; }
  .portal-kpi strong { font-size: 1.5rem; }
  .portal-who, .portal-brand-sub { display: none; }
  .portal-logo { max-height: 32px; max-width: 150px; }
  .portal-search { min-width: 0; flex: 1; }
  table.portal-cards, table.portal-cards tbody { display: block; }
  table.portal-cards thead { display: none; }
  table.portal-cards tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  table.portal-cards td { display: block; border: 0; padding: 0 !important; }
  table.portal-cards td.card-title { grid-column: 1 / -1; order: -1; font-weight: 600; }
  table.portal-cards td.card-meta { order: -2; grid-column: 1 / -1; }
  table.portal-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  table.portal-cards td.empty { grid-column: 1 / -1; }
  .portal-res-table { table-layout: auto; }
  table.portal-users td.portal-area-col { text-align: left; display: flex; align-items: center; gap: .4rem; }
  table.portal-users td.portal-area-col::before { order: 2; }
  .page-head { flex-wrap: wrap; gap: .6rem; }
}
/* Verwaltung › Systemhaus */
.company-form > .panel { margin-bottom: 1rem; }
.company-uses { margin: 0 0 .6rem; padding-left: 1.1rem; display: grid; gap: .3rem; }
/* Portal: Mein Konto */
a.portal-who { color: var(--ink); text-decoration: none; }
a.portal-who:hover .muted { text-decoration: underline; }
.portal-account-icon { display: none; width: 2.2rem; height: 2.2rem; border-radius: 999px; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--ink); }
.portal-account-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-narrow { max-width: 560px; }
@media (max-width: 700px) { .portal-account-icon { display: inline-flex; } }

/* Monitor-Freigaben (Verwaltungsseite); die Monitoransicht selbst hat eigene Stile in display.css */
.display-new { border: 2px solid var(--accent); }
.display-new .copy-line code { word-break: break-all; }
tr.is-highlight td { background: var(--accent-soft); }
.check-stack { justify-content: flex-end; gap: .4rem; }
.relay-names table { margin: .3rem 0; }
.relay-names input[type=text] { width: 100%; min-width: 9rem; padding: .25rem .4rem; }
.break { word-break: break-all; }
.supply-form { display: grid; gap: .15rem; min-width: 15rem; }
.supply-form select { font-size: .8rem; padding: .2rem .3rem; }

/* Fehlersuche */
.check-row { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-bottom: .6rem; }
.logai-form .check-item { margin-bottom: .2rem; }
.logai-script { max-height: 18rem; overflow: auto; background: var(--surface-2, #f3f5f8); padding: .6rem .75rem; border-radius: var(--radius); font-size: .75rem; white-space: pre; margin: .4rem 0; }
.logai-finding { border-left: 4px solid var(--line); padding: .3rem 0 .3rem .8rem; margin: 0 0 .9rem; }
.logai-finding.kritisch, .logai-finding.hoch { border-left-color: var(--crit); }
.logai-finding.mittel { border-left-color: var(--warn); }
.logai-steps { margin: .3rem 0 .8rem 1.2rem; }

/* Ausnahmen mit Bedingungen */
.exc-conditions td { vertical-align: top; }
.exc-conditions input:not([type=checkbox]), .exc-conditions textarea { width: 100%; min-width: 14rem; }
.exc-conditions select { min-width: 10rem; }

/* Sicherheitsbericht und Sicherheitsstatus (Score-Ring, Verlauf, Kacheln) */
.score-ring { position: relative; width: 168px; height: 168px; flex: 0 0 auto; }
.score-ring svg { width: 100%; height: 100%; }
.score-track { fill: none; stroke: var(--line); stroke-width: 12; }
.score-arc { fill: none; stroke: var(--ok); stroke-width: 12; stroke-linecap: round; }
.score-gelb .score-arc { stroke: var(--warn); }
.score-rot .score-arc { stroke: var(--crit); }
.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-center strong { font-size: 2.6rem; line-height: 1; font-weight: 600; }
.score-center span { font-size: .8rem; color: var(--muted); }
.score-delta.up { color: var(--ok); } .score-delta.down { color: var(--crit); }
.score-trend { width: 100%; max-width: 520px; height: auto; margin-top: .4rem; }
.trend-base { stroke: var(--line); stroke-width: 1; }
.trend-line { fill: none; stroke: var(--ok); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: var(--ok); }
.trend-label { font-size: 10px; fill: var(--muted); }
.sec-hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.sec-hero-text { flex: 1 1 280px; min-width: 0; }
.sec-hero-text p { font-size: 1.02rem; line-height: 1.6; margin-top: 0; }
.sec-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-top: .8rem; }
.sec-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; }
.sec-tile span { display: block; font-size: .8rem; color: var(--muted); }
.sec-tile strong { font-size: 1.4rem; }
.sec-tile.is-crit strong { color: var(--crit); } .sec-tile.is-warn strong { color: var(--warn); } .sec-tile.is-ok strong { color: var(--ok); }
.sec-bar { margin-bottom: .7rem; } .sec-bar-head { display: flex; justify-content: space-between; font-size: .88rem; }
.sec-bar meter { width: 100%; height: .55rem; }
.sec-list { list-style: none; padding: 0; margin: .2rem 0 1rem; }
.sec-list li { padding: .2rem 0 .2rem 1.4rem; position: relative; }
.sec-list.ok li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 600; }
.sec-list.warn li::before { content: "→"; position: absolute; left: 0; color: var(--warn); font-weight: 600; }
.score-badge { display: inline-block; min-width: 2.4rem; text-align: center; padding: .1rem .4rem; border-radius: 999px; font-weight: 600; }
.score-badge.is-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.score-badge.is-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.score-badge.is-crit { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
.sec-live { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); }
.sec-live::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); animation: sec-pulse 2s ease-in-out infinite; }
@keyframes sec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sec-live::before { animation: none; } }
.svc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.svc-row:first-of-type { border-top: 0; }
.sec-tile span:last-child { font-size: .78rem; }
.sec-reports { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.sec-tile svg, .sec-reports svg { width: 1em; height: 1em; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sec-list li.muted, .sec-list li.portal-good { padding-left: 0; }
.sec-list li.muted::before, .sec-list li.portal-good::before { content: none; }
