/* LiftPLAN360 – Oberfläche
   Farben und Schrift nach dem Erscheinungsbild von LiftPLAN360 (Logo-Verlauf Petrol, Montserrat). */

@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/montserrat-latin-400-normal.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: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/montserrat-latin-500-normal.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: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/montserrat-latin-600-normal.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: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/montserrat-latin-700-normal.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: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/montserrat-latin-ext-400-normal.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: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/montserrat-latin-ext-600-normal.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; }

:root {
  --petrol-950: #0c3439;
  --petrol-900: #0f3c42;
  --petrol-800: #18555d;
  --petrol-700: #1f6670;
  --teal-600: #2d8693;
  --teal-200: #b9dce0;
  --teal-100: #e1f0f2;
  --teal-50: #f0f8f9;
  --paper: #f2f5f5;
  --surface: #ffffff;
  --ink: #16292c;
  --ink-2: #4b6064;
  --ink-3: #6f8387;
  --line: #d6e0e1;
  --line-2: #e7eeef;

  --red: #b42318;   --red-bg: #fdeceb;   --red-line: #f3c4bf;
  --amber: #a14a06; --amber-bg: #fdf1e3; --amber-line: #f2d0a6;
  --green: #12704a; --green-bg: #e5f4ec; --green-line: #b5dfc8;
  --blue: #2d5b94;  --blue-bg: #e8eff8;  --blue-line: #c3d4ea;

  --brand-gradient: linear-gradient(120deg, #18555d 0%, #2d8693 100%);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(12, 52, 57, .06);
  --focus: 0 0 0 3px rgba(45, 134, 147, .35);
  --sidebar: 248px;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'tnum' 0;
}
img { max-width: 100%; }
svg.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
a { color: var(--petrol-800); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-600); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--ink-3); }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

/* ---------- App-Rahmen ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--petrol-900);
  color: #dcecee;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
}
.sidebar__brand { display: block; padding: 4px 8px 18px; }
.sidebar__brand img { width: 172px; height: auto; display: block; }
.sidebar__section { margin-top: 10px; }
.sidebar__label { font-size: 12px; color: #8fb3b8; padding: 10px 10px 6px; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  color: #d6e8ea; text-decoration: none;
  padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current='page'] { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a[aria-current='page']::before {
  content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 4px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #5fb6c1, #2d8693);
}
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 19px; }
.sidebar__bottom { margin-top: auto; padding-top: 16px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.userbox__name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.userbox__role { font-size: 12px; color: #8fb3b8; }
.userbox form { margin-left: auto; }
.userbox .linkbtn { color: #b9dce0; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }

.backdrop { display: none; }

@media (max-width: 1099px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; height: auto;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 30, 33, .45); z-index: 30; }
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    background: var(--petrol-900); color: #fff;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }
  .topbar img { height: 26px; width: auto; }
  .topbar__menu { background: none; border: 0; color: #fff; padding: 6px; margin-left: -6px; display: grid; place-items: center; }
  .topbar__menu svg { width: 24px; height: 24px; }
  .content { padding: 22px 20px 40px; }
}
@media (max-width: 759px) {
  body { font-size: 14px; }
  h1 { font-size: 22px; }
  .content { padding: 18px 14px calc(36px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__text { min-width: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px 14px; min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--teal-600); color: var(--petrol-800); }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--petrol-800); border-color: var(--petrol-800); color: #fff; }
.btn--primary:hover { background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; }
.btn--danger { color: var(--red); border-color: var(--red-line); }
.btn--danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--petrol-800); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel__head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.panel__body { padding: 18px 20px; }
.panel__body--flush { padding: 0; }
.panel__foot { padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stack > * + * { margin-top: 20px; }
@media (max-width: 1099px) { .grid-2, .grid-halves { grid-template-columns: 1fr; } }
.section-gap { margin-top: 20px; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--teal-600); }
.kpi__label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi__value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi__sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi--alert { border-color: var(--red-line); box-shadow: inset 4px 0 0 var(--red); }
.kpi--alert .kpi__value { color: var(--red); }
.kpi--warn .kpi__value { color: var(--amber); }
@media (max-width: 1099px) { .kpis, .kpis--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpi__value { font-size: 24px; } }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--teal-50); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f7fbfb; }
.table .r { text-align: right; }
.table td.r, .table th.r { font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; background: var(--teal-50); border-top: 1px solid var(--line); }
.table a.rowlink { font-weight: 600; text-decoration: none; color: var(--ink); }
.table a.rowlink:hover { color: var(--petrol-800); text-decoration: underline; }
.table .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.table .actions { text-align: right; white-space: nowrap; }
.table--compact td { padding: 8px 14px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.empty p { margin-bottom: 12px; }

@media (max-width: 759px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .table--stack td { border: 0; padding: 3px 0; text-align: right; overflow: hidden; }
  .table--stack td::before { content: attr(data-label); float: left; font-size: 12.5px; color: var(--ink-3); text-align: left; max-width: 45%; margin-right: 12px; padding-top: 1px; }
  .table--stack td .sub { display: block; }
  .table--stack td.primary { text-align: left; font-size: 15px; padding-bottom: 6px; }
  .table--stack td.primary::before { content: none; }
  .table--stack td:empty { display: none; }
  .table--stack td.actions { padding-top: 6px; }
  .table--stack td.actions::before { content: none; }
  .table--stack tfoot { display: block; }
  .table--stack tfoot tr { display: flex; justify-content: space-between; }
}

/* ---------- Status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; line-height: 1.4; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--ueberfaellig { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.chip--aktuell { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.chip--zukuenftig { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.chip--erledigt { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.chip--offen { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.chip--neutral { color: var(--ink-2); background: var(--line-2); }
.chip--neutral::before { display: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }

.status-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.status-filter a { text-decoration: none; }
.status-filter a.chip { opacity: .55; }
.status-filter a.chip.is-active, .status-filter a.chip:hover { opacity: 1; }
.status-filter a.chip--all { color: var(--petrol-800); background: var(--teal-100); border-color: var(--teal-200); }
.status-filter a.chip--all::before { display: none; }

/* Prüfplakette: nächste Frist als Plakette mit Jahr und markiertem Monat */
.plakette { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.plakette svg { width: 38px; height: 38px; flex: none; }
.plakette--lg svg { width: 64px; height: 64px; }
.plakette__text { font-size: 13px; line-height: 1.35; }
.plakette__text strong { display: block; font-size: 13.5px; }
.plakette--none { color: var(--ink-3); font-size: 13px; }

/* ---------- Filterleiste ---------- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; }
.filters__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.filters select, .filters input { font-size: 14px; min-height: 40px; }
.filters__row + .filters__row { margin-top: 10px; }
.filters__search { grid-column: span 2; }
.filters__period { display: flex; align-items: center; gap: 8px; grid-column: span 2; flex-wrap: wrap; }
.filters__period input { width: 165px; flex: 0 1 165px; }
.filters__summary { display: none; }
.filters__period span { color: var(--ink-3); font-size: 13px; }
.filters__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.filters__note { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 759px) {
  .filters { padding: 12px; }
  .filters__search, .filters__period { grid-column: 1 / -1; }
  .filters__row { grid-template-columns: 1fr 1fr; }
  .filters__summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
  .filters__summary::-webkit-details-marker { display: none; }
  .filters__details[open] .filters__summary { margin-bottom: 12px; }
  .filters__period { gap: 6px; }
  .filters__period input { flex: 1 1 120px; width: auto; }
  .filters__period > span:first-child { width: 100%; }
}

/* ---------- Formulare ---------- */
label { font-size: 13.5px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 5px; }
.input, input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='search'], input[type='tel'], input[type='file'], select, textarea {
  width: 100%;
  font: inherit; font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c4d2d4;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  min-height: 42px;
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234b6064' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type='date'] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-600); box-shadow: var(--focus); }
input[type='checkbox'], input[type='radio'] { width: 18px; height: 18px; accent-color: var(--petrol-800); margin: 0; }
.field { margin-bottom: 16px; min-width: 0; }
.field__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.field__error { font-size: 13px; color: var(--red); margin-top: 4px; font-weight: 500; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.inline-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 10px; }
.inline-fields--zip { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 12px; color: var(--petrol-800); }
.fieldset { border-top: 1px solid var(--line-2); padding-top: 18px; margin-top: 6px; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin-right: 18px; }
.segmented { display: inline-flex; border: 1px solid #c4d2d4; border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { margin: 0; font-weight: 500; font-size: 14px; position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 9px 14px; cursor: pointer; border-right: 1px solid #c4d2d4; background: #fff; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--petrol-800); color: #fff; }
.segmented input:focus-visible + span { box-shadow: inset var(--focus); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
.form-actions--split { justify-content: space-between; }
.changed-by { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
@media (max-width: 759px) {
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .form-actions .btn { flex: 1; }
}

/* ---------- Hinweise ---------- */
.flash { border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash--success { background: var(--green-bg); border-color: var(--green-line); color: #0e5a3b; }
.flash--error { background: var(--red-bg); border-color: var(--red-line); color: #8f1c13; }
.flash--info { background: var(--teal-50); border-color: var(--teal-200); color: var(--petrol-800); }
.flash--warn { background: var(--amber-bg); border-color: var(--amber-line); color: #7a3906; }
.callout { background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- Detailansichten ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.facts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts div { padding: 9px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 759px) { .facts, .facts--3 { grid-template-columns: 1fr; } }
.subnav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; -webkit-overflow-scrolling: touch; }
.subnav a { padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.subnav a:hover { color: var(--petrol-800); }
.subnav a .badge { margin-left: 4px; }
.subnav a[aria-current='page'] { color: var(--petrol-900); border-bottom-color: var(--petrol-800); }
.record-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.record-head__meta { color: var(--ink-2); font-size: 14px; }
.provider-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.provider-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--teal-50); }
.provider-card h3 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.provider-card .name { font-weight: 600; }
.provider-card p { margin: 4px 0 0; font-size: 13.5px; }
.provider-card .emergency { margin-top: 8px; font-weight: 600; color: var(--red); }
@media (max-width: 1099px) { .provider-cards { grid-template-columns: 1fr; } }

/* ---------- Balken (Kostenverteilung, Auswertungen) ---------- */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 0; }
.bars .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bars .bar span { display: block; height: 100%; border-radius: 4px; background: var(--teal-600); }
.bars .label { font-size: 14px; }
.bars .value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-inline { display: inline-block; width: 90px; height: 7px; border-radius: 4px; background: var(--line-2); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.bar-inline span { display: block; height: 100%; background: var(--teal-600); }
.total-line { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.total-line strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative { color: var(--red); }

/* ---------- Dokumente ---------- */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.folder { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: #fff; }
.folder h3 { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 8px; }
.folder ul { list-style: none; margin: 0; padding: 0; }
.folder li { font-size: 13.5px; padding: 5px 0; border-top: 1px dashed var(--line-2); display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.folder li a { overflow-wrap: anywhere; }
.folder .empty-folder { color: var(--ink-3); font-size: 13px; }
.upload { border: 1px dashed var(--teal-600); border-radius: var(--radius-sm); padding: 16px; background: var(--teal-50); margin-bottom: 16px; }
.doc-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--paper); }
.auth__brand { background: var(--brand-gradient); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__brand img { width: 230px; height: auto; position: relative; }
.auth__brand p { font-size: 15px; color: #d7eef1; max-width: 34ch; position: relative; margin: 0; }
.auth__shaft { position: absolute; right: 12%; top: 0; bottom: 0; width: 120px; border-left: 1px solid rgba(255, 255, 255, .16); border-right: 1px solid rgba(255, 255, 255, .16); }
.auth__shaft::before { content: ''; position: absolute; left: 14px; right: 14px; top: 38%; height: 150px; border: 1.5px solid rgba(255, 255, 255, .45); border-radius: 4px; }
.auth__shaft::after { content: ''; position: absolute; left: 50%; top: 38%; height: 150px; border-left: 1.5px solid rgba(255, 255, 255, .35); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { margin-bottom: 8px; }
.auth__card .lead { color: var(--ink-2); margin-bottom: 24px; }
.auth__divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.auth__divider::before, .auth__divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth__links { margin-top: 18px; font-size: 14px; }
.auth__mobile-logo { display: none; }
@media (max-width: 859px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__mobile-logo { display: block; width: 190px; margin-bottom: 28px; }
  .auth__form { align-items: flex-start; padding-top: calc(48px + env(safe-area-inset-top)); }
}

/* ---------- Schmale Bildschirme (iPhone SE, geteilte Ansicht auf dem iPad) ---------- */
@media (max-width: 479px) {
  .btn { white-space: normal; text-align: center; max-width: 100%; line-height: 1.25; }
  .chip { white-space: normal; text-align: left; }
}

/* ---------- Import und Export ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 52px; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--petrol-800); color: #fff; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.steps > li:not(:last-child)::after { content: ''; position: absolute; left: 16px; top: 38px; bottom: 6px; border-left: 2px solid var(--teal-200); }
.steps h3 { font-size: 16px; margin: 4px 0 4px; }
.steps p { color: var(--ink-2); margin: 0 0 12px; max-width: 75ch; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 1px dashed var(--teal-600); border-radius: var(--radius-sm); background: var(--teal-50); }
.upload-row input[type='file'] { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 14px; }
.note-text { color: var(--ink-3); font-size: 13px; margin: 14px 0 0; }
.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff; }
.disclosure > summary { cursor: pointer; padding: 12px 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; align-self: center; flex: none; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line-2); }
.disclosure > .table-wrap { border: 0; }
.disclosure > p { padding: 0 14px 12px; margin: 10px 0 0; }
.plain-list { margin: 0; padding: 10px 14px 12px 32px; }
.plain-list li { padding: 2px 0; }
.h3 { font-size: 16px; margin-bottom: 10px; }
.table .show-stack, .show-stack { display: none; }
@media (max-width: 759px) {
  .table--stack td.hide-stack { display: none; }
  .table--stack td .show-stack { display: inline; }
  .table--stack td .sub.show-stack { display: block; }
  .steps > li { padding-left: 46px; }
}
@media (prefers-reduced-motion: reduce) { .disclosure > summary::before { transition: none; } }

/* ---------- Einstellungen / Listen ---------- */
.option-list { list-style: none; margin: 0; padding: 0; }
.option-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.option-list li.inactive .option-value { color: var(--ink-3); text-decoration: line-through; }
.option-list .option-name { flex: 1; min-width: 160px; }
.option-list input[type='text'] { min-height: 34px; padding: 5px 9px; font-size: 14px; max-width: 280px; }
.option-list .option-used { display: block; font-size: 12.5px; color: var(--ink-3); }
.option-list .option-actions { display: inline-flex; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.option-add { display: flex; gap: 8px; margin-top: 12px; }
.option-add input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn:hover:not(:disabled) { background: var(--teal-50); border-color: var(--teal-200); color: var(--petrol-800); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.icon-btn svg.icon { width: 18px; height: 18px; }
.group-title { font-size: 18px; margin: 26px 0 12px; }
.group-title:first-of-type { margin-top: 4px; }
.list-grid { align-items: start; }
.list-grid > .panel { margin-bottom: 0; }
@media (max-width: 759px) {
  .option-list li { gap: 4px 6px; flex-wrap: nowrap; }
  .option-list .option-name { min-width: 0; overflow-wrap: anywhere; }
  .icon-btn { width: 32px; height: 36px; }
}
.perm-table td, .perm-table th { vertical-align: middle; }
.perm-table td.c, .perm-table th.c { text-align: center; }

/* ---------- Benutzer und Konto ---------- */
.perm-list { border-top: 1px solid var(--line-2); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.perm-row__label { min-width: 0; flex: 1 1 260px; }
.perm-row__label .field__hint { display: block; margin-top: 2px; }
.perm-line { display: block; font-size: 13.5px; line-height: 1.45; }
.perm-line + .perm-line { margin-top: 3px; }
.perm-tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); margin-right: 4px; }
.perm-tag--write { background: var(--teal-100); color: var(--petrol-800); }
.action-list { display: grid; gap: 0; }
.action-item { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.action-item:first-child { padding-top: 0; }
.action-item:last-child { border-bottom: 0; padding-bottom: 0; }
.action-item > div { flex: 1 1 260px; min-width: 0; }
.action-item .field__hint { display: block; }
.copy-field { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.copy-field input { flex: 1 1 280px; min-width: 0; font-size: 13.5px; }
.passkey-add { display: flex; gap: 10px 14px; align-items: flex-end; flex-wrap: wrap; }
.passkey-add .field { flex: 1 1 240px; margin-bottom: 0; max-width: 360px; }
@media (max-width: 759px) {
  .perm-row .segmented { width: 100%; }
  .perm-row .segmented label { flex: 1; text-align: center; }
  .action-item .btn { width: 100%; }
}

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(8, 30, 33, .45); }
.dialog__body { padding: 22px; }
.dialog__body h2 { margin-bottom: 12px; }

.footer-note { color: var(--ink-3); font-size: 12.5px; padding-top: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media print {
  .sidebar, .topbar, .filters, .page-head__actions, .btn, .no-print { display: none !important; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
