/* panther – eigenes, schlichtes Design (Designtokens als CSS-Variablen).
   Markenfarbe kommt aus /theme.css (BRAND_COLOR), alles andere hier. */
:root {
  --pgm-brand: #1c2a4b;
  --pgm-brand-ink: #ffffff;
  --pgm-bg: #f4f5f3;
  --pgm-surface: #ffffff;
  --pgm-ink: #1c2321;
  --pgm-muted: #5b6662;
  --pgm-line: #dde1de;
  --pgm-soft: #eef1ee;
  --pgm-ok: #1f7a3a;
  --pgm-ok-bg: #e6f4ea;
  --pgm-warn: #8a5a00;
  --pgm-warn-bg: #fff4d6;
  --pgm-error: #b3261e;
  --pgm-error-bg: #fdecea;
  --pgm-radius: 12px;
  --pgm-radius-sm: 8px;
  --pgm-shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .05);
  --pgm-touch: 44px;
  --pgm-sidebar: 248px;
  --pgm-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pgm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--pgm-font); font-size: 16px; line-height: 1.5; color: var(--pgm-ink); background: var(--pgm-bg); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
p { margin: 0 0 .5rem; }
a { color: var(--pgm-brand); }
.muted { color: var(--pgm-muted); }
.mono { font-family: var(--pgm-mono); font-size: .8rem; color: var(--pgm-muted); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--pgm-brand); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--pgm-surface); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Schaltflächen, Hinweise, Badges --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--pgm-touch); padding: 0 1.1rem; border-radius: var(--pgm-radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--pgm-brand); color: var(--pgm-brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--pgm-surface); color: var(--pgm-ink); border-color: var(--pgm-line); }
.btn-secondary:hover { background: var(--pgm-soft); }
.btn-block { width: 100%; margin-top: 1.25rem; font-size: 1.05rem; }
.btn.is-disabled { opacity: .45; cursor: default; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: var(--pgm-touch); height: var(--pgm-touch); border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); background: var(--pgm-surface); color: var(--pgm-ink); cursor: pointer; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-role { background: var(--pgm-brand); color: var(--pgm-brand-ink); }
.badge-muted { background: var(--pgm-soft); color: var(--pgm-muted); }
.notice { padding: .75rem 1rem; border-radius: var(--pgm-radius-sm); margin: 1rem 0 0; }
.notice-ok { background: var(--pgm-ok-bg); color: var(--pgm-ok); }
.notice-error { background: var(--pgm-error-bg); color: var(--pgm-error); }

/* --- Karten-Seiten (Anmelden, Kein Zugriff) --- */
body.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 26rem; background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); padding: 2rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand-lg { font-size: 1.15rem; margin-bottom: 1.5rem; }

/* --- App-Gerüst: Seitenleiste + Inhalt --- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--pgm-sidebar); flex: none; background: var(--pgm-surface); border-right: 1px solid var(--pgm-line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: .25rem .5rem 1rem; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.nav-link { display: flex; align-items: center; gap: .75rem; min-height: var(--pgm-touch); padding: 0 .75rem; border-radius: var(--pgm-radius-sm); color: var(--pgm-ink); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: var(--pgm-soft); }
.nav-link.is-active { background: var(--pgm-brand); color: var(--pgm-brand-ink); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; background: var(--pgm-surface); border-bottom: 1px solid var(--pgm-line); }
.sidebar-toggle { display: none; }
.search { flex: 1; max-width: 32rem; display: flex; align-items: center; gap: .5rem; min-height: var(--pgm-touch); padding: 0 .75rem; border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); background: var(--pgm-soft); color: var(--pgm-muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; }
.user { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; gap: .15rem; }
.user-name { font-weight: 600; }
.logout { margin: 0; }
.content { padding: 1.5rem 1.25rem 3rem; max-width: 80rem; width: 100%; }
.page-head { margin-bottom: 1.25rem; }
.section { margin-bottom: 1.5rem; }
.card { background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); padding: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }
.empty { border: 2px dashed var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: 1.25rem; text-align: center; }
.placeholder { text-align: center; padding: 2.5rem 1.25rem; }
.placeholder-milestone { font-size: 1.2rem; font-weight: 700; }

/* --- Kacheln „Zu erledigen“ --- */
.tiles { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.tile { display: flex; gap: 1rem; background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); padding: 1rem; border-left: 5px solid var(--pgm-brand); }
.tile-placeholder { border-left-color: var(--pgm-line); }
.tile-count { font-size: 1.8rem; font-weight: 700; min-width: 2.5rem; color: var(--pgm-muted); }
.tile-body p { color: var(--pgm-muted); font-size: .92rem; }

/* --- Tabellen --- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 44rem; }
.table th { text-align: left; background: var(--pgm-soft); font-weight: 600; padding: .75rem 1rem; }
.table td { padding: .7rem 1rem; border-top: 1px solid var(--pgm-line); vertical-align: top; }
.table .mono { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-row { text-align: center; color: var(--pgm-muted); padding: 1.5rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

/* --- M1: Formulare --- */
.form { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .9rem 1.1rem; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; margin: 0; }
fieldset.field, fieldset.geo, fieldset.rhythm { border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .9rem 1rem 1rem; }
legend { font-weight: 600; padding: 0 .35rem; }
label, .label { font-weight: 600; font-size: .92rem; margin: 0; }
.req { color: var(--pgm-error); }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea {
  font: inherit; color: var(--pgm-ink); background: var(--pgm-surface); border: 1px solid #b9c1bc; border-radius: var(--pgm-radius-sm);
  min-height: var(--pgm-touch); padding: .45rem .7rem; width: 100%; }
textarea { min-height: 5rem; resize: vertical; }
input[type=file] { padding: .55rem; }
.mono-input { font-family: var(--pgm-mono); font-size: .9rem; }
.help { color: var(--pgm-muted); font-size: .85rem; margin: 0; }
.field-error { color: var(--pgm-error); font-weight: 600; font-size: .88rem; margin: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--pgm-error); box-shadow: 0 0 0 1px var(--pgm-error); }
.field-check { flex-direction: column; }
.check { display: inline-flex; align-items: center; gap: .55rem; min-height: var(--pgm-touch); font-weight: 500; cursor: pointer; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--pgm-brand); }
.checkgroup-items { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.form-actions-card { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.inline-form { display: inline; margin: 0; }
.btn-small { min-height: 36px; padding: 0 .75rem; font-size: .88rem; }
.btn-danger-outline { background: var(--pgm-surface); color: var(--pgm-error); border-color: var(--pgm-error); }
.btn-danger-outline:hover { background: var(--pgm-error-bg); }
.details { border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .75rem 1rem; }
.details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.details[open] summary { margin-bottom: .75rem; }
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.segment { position: relative; display: inline-flex; }
.segment input { position: absolute; opacity: 0; inset: 0; }
.segment span { display: inline-flex; align-items: center; min-height: var(--pgm-touch); padding: 0 .9rem; border: 1px solid var(--pgm-line); border-radius: 999px; background: var(--pgm-surface); font-weight: 500; cursor: pointer; }
.segment input:checked + span { background: var(--pgm-brand); color: var(--pgm-brand-ink); border-color: var(--pgm-brand); }
.segment input:focus-visible + span { outline: 3px solid var(--pgm-brand); outline-offset: 2px; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.check.day { position: relative; }
.check.day input { position: absolute; opacity: 0; inset: 0; }
.check.day span { display: inline-flex; align-items: center; justify-content: center; width: var(--pgm-touch); height: var(--pgm-touch); border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); }
.check.day input:checked + span { background: var(--pgm-brand); color: var(--pgm-brand-ink); border-color: var(--pgm-brand); }
.check.day input:focus-visible + span { outline: 3px solid var(--pgm-brand); outline-offset: 2px; }
.rhythm { display: grid; gap: .9rem; }
.rhythm-part[hidden], [data-show-mode][hidden] { display: none; }
.rrule-out { margin: 0; color: var(--pgm-muted); font-size: .88rem; word-break: break-all; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; }
.plan-layout > .card { display: grid; gap: 1rem; }
.preview { position: sticky; top: 5rem; }
.preview-list { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .3rem; }
.preview-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: var(--pgm-radius-sm); background: var(--pgm-soft); }
.preview-list li.is-cancelled .preview-date { text-decoration: line-through; color: var(--pgm-muted); }
.preview-date { font-variant-numeric: tabular-nums; font-weight: 600; }
.schedule-grid { display: grid; gap: .5rem; }
.schedule-day { display: grid; grid-template-columns: 3rem 1fr auto; gap: .5rem; align-items: start; padding: .4rem 0; border-top: 1px solid var(--pgm-line); }
.schedule-day:first-child { border-top: 0; }
.schedule-label { font-weight: 700; line-height: var(--pgm-touch); }
.schedule-windows { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.schedule-window { display: flex; align-items: center; gap: .35rem; }
.schedule-window input { width: 8.5rem; }
.map { height: 320px; border-radius: var(--pgm-radius-sm); border: 1px solid var(--pgm-line); margin: .75rem 0; z-index: 0; }
.map-edit { height: 360px; }
.grid-2 + .section, .grid-2 + section { margin-top: 1.5rem; }
.table-wrap + .form, .card + .form { margin-top: 1rem; }

/* --- M1: Listen, Detailseiten --- */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toolbar-form { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1; min-width: 16rem; }
.toolbar-form input[type=search] { flex: 1; min-width: 12rem; width: auto; }
.toolbar-form select { width: auto; }
.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; }
.sort-link.is-active { color: var(--pgm-brand); }
.sort-mark { font-size: .7rem; }
.badge-ok { background: var(--pgm-ok-bg); color: var(--pgm-ok); }
.badge-warn { background: var(--pgm-warn-bg); color: var(--pgm-warn); }
.badge-error { background: var(--pgm-error-bg); color: var(--pgm-error); }
.notice-warn { background: var(--pgm-warn-bg); color: var(--pgm-warn); }
.flash { margin: 0 0 1rem; }
.geo-backfill { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; }
.crumbs { margin: 0 0 .25rem; font-size: .9rem; color: var(--pgm-muted); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.head-row h1, .head-row h2 { margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.facts { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .45rem 1rem; margin: 0; }
.facts dt { color: var(--pgm-muted); font-weight: 600; }
.facts dd { margin: 0; }
.pre { white-space: pre-line; }
.small { font-size: .85rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.hub-tile { display: flex; flex-direction: column; gap: .35rem; min-height: 6rem; padding: 1.1rem; background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); color: var(--pgm-ink); text-decoration: none; border-left: 5px solid var(--pgm-brand); }
.hub-tile:hover { background: var(--pgm-soft); }
.hub-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.figures { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.figure { display: flex; align-items: baseline; gap: .5rem; padding: .7rem 1.1rem; min-height: var(--pgm-touch); background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); color: var(--pgm-ink); text-decoration: none; }
a.figure:hover { background: var(--pgm-soft); }
.figure-value { font-size: 1.5rem; font-weight: 700; color: var(--pgm-brand); font-variant-numeric: tabular-nums; }
.figure-label { color: var(--pgm-muted); font-weight: 600; }
.figure-ok .figure-value { color: var(--pgm-ok); }
.figure-error .figure-value { color: var(--pgm-error); }
.figure-warn .figure-value { color: var(--pgm-warn); }
.table.mapping { min-width: 0; }
.table.mapping th[scope=row] { background: transparent; }
tr.row-error td:first-child { border-left: 4px solid var(--pgm-error); }
tr.row-duplicate td:first-child { border-left: 4px solid var(--pgm-warn); }

/* --- M1: Globale Suche --- */
.search { position: relative; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; list-style: none; margin: 0; padding: .3rem; background: var(--pgm-surface); border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); box-shadow: 0 8px 24px rgba(20, 30, 25, .15); max-height: 70vh; overflow-y: auto; color: var(--pgm-ink); }
.search-results [role=option] { display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; padding: .55rem .65rem; border-radius: var(--pgm-radius-sm); cursor: pointer; min-height: var(--pgm-touch); }
.search-results [role=option][aria-selected=true], .search-results [role=option]:hover { background: var(--pgm-soft); }
.search-type { grid-row: span 2; align-self: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--pgm-muted); min-width: 5.5rem; }
.search-label { font-weight: 600; }
.search-sub { color: var(--pgm-muted); font-size: .85rem; }
.search-empty { padding: .6rem; color: var(--pgm-muted); }

/* --- Tablet und schmaler: Seitenleiste einklappbar --- */
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--pgm-shadow); }
  .shell.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop { display: none; }
  .shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .3); }
  .sidebar-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  .plan-layout { grid-template-columns: 1fr; }
  .preview { position: static; }
  .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .user-name { font-size: .9rem; }
  .content { padding: 1rem .75rem 2rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* --- M2: Start-Kacheln mit Zahl --- */
.tile-active { padding: 0; }
.tile-link { display: flex; gap: 1rem; padding: 1rem; width: 100%; color: var(--pgm-ink); text-decoration: none; border-radius: var(--pgm-radius); min-height: var(--pgm-touch); }
.tile-link:hover { background: var(--pgm-soft); }
.tile-active .tile-count { color: var(--pgm-brand); }
.tile-title { display: block; font-weight: 700; }
.tile-text { display: block; color: var(--pgm-muted); font-size: .92rem; }

/* --- M2: Wochenplaner --- */
.week-nav { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.week-label { padding: 0 .5rem; }
.legend span { margin-right: .6rem; white-space: nowrap; }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.planner-layout:has(.panel:not([hidden])) { grid-template-columns: minmax(0, 1fr) 24rem; }
.planner-scroll { overflow-x: auto; background: var(--pgm-surface); border-radius: var(--pgm-radius); box-shadow: var(--pgm-shadow); }
.planner-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 64rem; table-layout: fixed; font-size: .88rem; }
.planner-table th, .planner-table td { border-bottom: 1px solid var(--pgm-line); border-right: 1px solid var(--pgm-line); vertical-align: top; }
.planner-corner, .planner-emp { width: 9rem; text-align: left; padding: .5rem .6rem; background: var(--pgm-soft); position: sticky; left: 0; z-index: 2; font-weight: 600; }
.planner-day { padding: .45rem .5rem; background: var(--pgm-soft); text-align: left; }
.planner-day-label { display: block; font-weight: 700; }
.planner-day.is-today { box-shadow: inset 0 -3px 0 var(--pgm-brand); }
.planner-off { display: block; font-size: .78rem; font-weight: 600; color: var(--pgm-warn); }
.cell { padding: .35rem; min-height: 5rem; height: 5rem; background: var(--pgm-surface); }
.cell.is-off { background: repeating-linear-gradient(135deg, #fff8e6, #fff8e6 8px, #fff 8px, #fff 16px); }
.cell.is-free { background: #f8f9f8; }
.cell.is-absent { background: repeating-linear-gradient(135deg, #f3eded, #f3eded 8px, #fbf8f8 8px, #fbf8f8 16px); }
.cell.is-over { outline: 3px dashed var(--pgm-brand); outline-offset: -3px; }
.cell-head { display: flex; justify-content: space-between; gap: .3rem; min-height: 1.1rem; font-size: .75rem; }
.cell-flag { color: var(--pgm-muted); font-weight: 600; }
.cell-day { margin-left: auto; color: var(--pgm-muted); }
.appt { display: grid; gap: .1rem; margin: 0 0 .35rem; padding: .4rem .5rem; border-radius: var(--pgm-radius-sm); border: 1px solid var(--pgm-line); border-left: 5px solid #8a96a3; background: #fff; cursor: pointer; min-height: var(--pgm-touch); overflow-wrap: anywhere; }
.appt[draggable=true] { cursor: grab; }
.appt:hover { background: var(--pgm-soft); }
.appt.is-selected { box-shadow: 0 0 0 3px var(--pgm-brand); }
.appt.is-dragging { opacity: .5; }
.appt-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .3rem; }
.appt-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.appt-status { font-size: .75rem; color: var(--pgm-muted); white-space: nowrap; }
.appt-obj { font-weight: 600; }
.appt-svc, .appt-note { font-size: .78rem; color: var(--pgm-muted); }
.appt-warn { font-size: .78rem; font-weight: 700; }
.appt.status-proposed { border-style: dashed; border-left-style: solid; border-left-color: #5b7fb5; }
.appt.status-approved { border-left-color: var(--pgm-ok); background: #f6fbf7; }
.appt.status-approved .appt-status { color: var(--pgm-ok); }
.appt.status-cancelled { opacity: .65; border-left-color: #b9c1bc; background: #f4f5f3; }
.appt.status-cancelled .appt-obj { text-decoration: line-through; }
.appt.sev-warning .appt-warn { color: var(--pgm-warn); }
.appt.sev-error .appt-warn { color: var(--pgm-error); }
.appt.sev-error { border-color: var(--pgm-error); }
.panel { position: sticky; top: 5rem; display: grid; gap: .5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.panel[hidden], [data-toast][hidden] { display: none; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.panel-head h2 { margin: 0; }
.panel-grid { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.issue { padding: .35rem .55rem; border-radius: var(--pgm-radius-sm); font-size: .88rem; }
.issue-error { background: var(--pgm-error-bg); color: var(--pgm-error); }
.issue-warning { background: var(--pgm-warn-bg); color: var(--pgm-warn); }
.issue-info { background: var(--pgm-soft); color: var(--pgm-muted); }
.saved-note { margin-bottom: .4rem; }
.warn-text { color: var(--pgm-warn); font-weight: 600; }
[data-approve-box] { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
[data-approve-box][hidden] { display: none; }

/* --- M2: Tagesansicht --- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.timeline-item { background: var(--pgm-surface); border-radius: var(--pgm-radius-sm); box-shadow: var(--pgm-shadow); padding: .6rem .8rem; border-left: 5px solid var(--pgm-line); }
.timeline-item.status-approved { border-left-color: var(--pgm-ok); }
.timeline-item.status-proposed { border-left-color: #5b7fb5; }
.timeline-time { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: .5rem; }
.timeline-gap { margin-left: 1.5rem; padding: .15rem .6rem; border-left: 2px dotted var(--pgm-line); color: var(--pgm-muted); font-size: .85rem; }
.timeline-gap.is-tight { color: var(--pgm-warn); border-left-color: var(--pgm-warn); }
.day-list li { padding: .25rem 0; }

/* --- M2: Kalender in der Mitarbeiterakte --- */
.calendar-card { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }
.calendar-card > div { flex: 1; min-width: 16rem; }
.qr { margin: 0; text-align: center; }
.qr img { background: #fff; border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .4rem; }
.break { overflow-wrap: anywhere; }
.toolbar-form .field { flex-direction: row; align-items: center; gap: .4rem; }
.toolbar-form .field select { width: auto; }

@media (max-width: 1100px) {
  .planner-layout:has(.panel:not([hidden])) { grid-template-columns: 1fr; }
  .panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 35; width: min(26rem, 100%); max-height: none; border-radius: 0; }
}

/* --- M3: Heute unterwegs, Neu seit gestern, Folgetermine, Meldungen in der Seitenleiste --- */
.today-list, .recent-list, .follow-list { display: grid; gap: .75rem; }
.today-name { font-size: 1rem; margin: 0 0 .25rem; }
.today-items { display: grid; gap: .4rem; }
.today-item { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; padding: .5rem .6rem; border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); background: var(--pgm-surface); }
.today-item.today-done { border-left: 4px solid var(--pgm-ok); }
.today-item.today-not_done, .today-item.today-missing { border-left: 4px solid var(--pgm-error); }
.today-link { display: flex; gap: .6rem; align-items: baseline; color: inherit; text-decoration: none; min-height: var(--pgm-touch); flex: 1 1 14rem; }
.today-link:hover strong, .today-link:focus-visible strong { text-decoration: underline; }
.today-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3rem; }
.stages { display: flex; flex-wrap: wrap; gap: .3rem; }
.stage { font-size: .8rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--pgm-line); white-space: nowrap; }
.stage-done { background: var(--pgm-ok-bg); color: var(--pgm-ok); border-color: transparent; }
.stage-error { background: var(--pgm-error-bg); color: var(--pgm-error); border-color: transparent; }
.stage-open { color: var(--pgm-muted); }
.recent-item { padding: .6rem; border-radius: var(--pgm-radius-sm); border: 1px solid var(--pgm-line); }
.recent-alert { border-color: var(--pgm-error); background: var(--pgm-error-bg); }
.recent-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.recent-text { margin: .35rem 0 0; white-space: pre-line; }
.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--pgm-line); background: var(--pgm-soft); }
.follow-item h2 { font-size: 1.05rem; }
.panel-section { border-top: 1px solid var(--pgm-line); margin-top: 1rem; padding-top: .75rem; }
.sub-list { display: grid; gap: .6rem; }
.sub-item { border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .5rem; }
.sub-item.sub-not_done { border-color: var(--pgm-error); }
.sub-meta { font-size: .8rem; color: var(--pgm-muted); word-break: break-all; }
.link-row { display: grid; gap: .25rem; margin-bottom: .6rem; }
.link-row input { width: 100%; font-family: var(--pgm-mono); font-size: .8rem; }

/* --- M4a: Berichte, Folgeaufträge, Planung „ohne Datum“ ------------------------------------------ */
.filter-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filter-tab { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--pgm-touch); padding: 0 .9rem; border: 1px solid var(--pgm-line); border-radius: 999px; background: var(--pgm-surface); color: var(--pgm-ink); text-decoration: none; font-weight: 500; }
.filter-tab.is-active { background: var(--pgm-brand); color: var(--pgm-brand-ink); border-color: var(--pgm-brand); }
.filter-tab.is-active .badge { background: rgba(255, 255, 255, .2); color: inherit; }
.report-badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .25rem 0 .5rem; }
.report-layout { display: grid; grid-template-columns: minmax(18rem, 2fr) minmax(22rem, 3fr); gap: 1.25rem; align-items: start; margin-top: 1rem; }
@media (max-width: 1100px) { .report-layout { grid-template-columns: 1fr; } }
.report-raw { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); overflow: auto; }
@media (max-width: 1100px) { .report-raw { position: static; max-height: none; } }
.raw-list { display: grid; gap: 1rem; }
.raw-item { border-left: 4px solid var(--pgm-line); padding-left: .75rem; }
.raw-item.sub-not_done { border-left-color: var(--pgm-error); }
.raw-item.sub-done { border-left-color: var(--pgm-ok); }
.raw-head { margin: 0 0 .25rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.raw-text { margin: .25rem 0; }
.raw-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0; }
.raw-photos img { width: 100%; max-width: 320px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--pgm-radius-sm); border: 1px solid var(--pgm-line); background: var(--pgm-soft); }
.report-form h3 { margin: 1.25rem 0 .4rem; font-size: 1.05rem; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.edit-list { display: grid; gap: .5rem; margin: 0 0 .4rem; }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: start; }
.list-row textarea { width: 100%; }
.list-row .field-error { grid-column: 1 / -1; }
.material-row { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
@media (max-width: 640px) { .material-row { grid-template-columns: 1fr 1fr; } }
.labor-table input.minutes { width: 6.5rem; }
.labor-table th[scope=row] { font-weight: 500; }
.finding-row { padding: .75rem; }
.photo-pick { border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .5rem; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.photo-choice { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--pgm-touch); padding: .2rem .4rem; border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); cursor: pointer; }
.photo-choice img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 8px rgba(20, 30, 25, .06); background: var(--pgm-surface); padding: .75rem 0; border-top: 1px solid var(--pgm-line); margin-top: 1rem; }
.kbd { font-size: .75rem; opacity: .75; margin-left: .3rem; font-weight: 400; }
.suggestion { border: 2px solid var(--pgm-warn); margin-top: 1rem; }
.diff-list { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.diff-list li { margin: .2rem 0; }
.diff-add { color: var(--pgm-ok); }
.diff-remove { color: var(--pgm-error); }
.follow-group h2 { margin-bottom: .25rem; }
.undated { border: 2px dashed var(--pgm-warn); border-radius: var(--pgm-radius); background: var(--pgm-warn-bg); padding: .6rem .8rem; margin-bottom: .75rem; }
.undated-title { font-size: 1rem; margin: 0 0 .2rem; display: flex; align-items: center; gap: .4rem; }
.undated-cards { display: flex; flex-wrap: wrap; gap: .5rem; }
.undated-cards .appt { max-width: 16rem; }
.panel-report { margin: .25rem 0 .5rem; }

/* --- M4b: Objektakte --- */
.akte-filter { margin-bottom: .75rem; }
.akte-filter .form-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.akte-list { display: grid; gap: .5rem; }
.akte-item { background: var(--pgm-surface); border-radius: var(--pgm-radius-sm); box-shadow: var(--pgm-shadow); padding: .6rem .9rem; border-left: 5px solid var(--pgm-line); }
.akte-item p { margin: .2rem 0; }
.akte-termin { border-left-color: #5b7fb5; }
.akte-vorgang { border-left-color: var(--pgm-muted); }
.akte-meldung { border-left-color: var(--pgm-line); }
.akte-bericht { border-left-color: var(--pgm-brand); }
.akte-bericht.is-approved { border-left-color: var(--pgm-ok); background: var(--pgm-ok-bg); }
.akte-folgeauftrag { border-left-color: var(--pgm-warn); }
.akte-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.akte-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.akte-sub { margin: .2rem 0; padding-left: 1rem; list-style: disc; }
.akte-text { color: var(--pgm-ink); }
.akte-photos img { width: 120px; height: 90px; object-fit: cover; }
.akte-more { list-style: none; text-align: center; padding: .5rem 0; }
.access-facts { margin: 0; }

/* --- M5: Planungs-Agent über dem Planer ------------------------------------------------------------- */
.agent { margin-bottom: 1.25rem; display: grid; gap: .75rem; }
.agent-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.agent-head h2 { margin: 0; }
.agent-text { width: 100%; min-height: 8rem; font-size: 1.05rem; line-height: 1.45; resize: vertical; }
.agent-sub { margin: .5rem 0 0; font-size: 1.05rem; }
.agent-history summary { cursor: pointer; font-weight: 600; min-height: var(--pgm-touch); display: flex; align-items: center; }
.agent-rounds { display: grid; gap: .4rem; margin-top: .4rem; font-size: .92rem; }
.agent-proposals { display: grid; gap: .6rem; }
.agent-proposal { border: 1px solid var(--pgm-line); border-left: 5px solid var(--pgm-ok); border-radius: var(--pgm-radius-sm); padding: .7rem .9rem; display: grid; gap: .5rem; background: var(--pgm-surface); }
.agent-proposal.sev-warning { border-left-color: var(--pgm-warn); }
.agent-proposal.sev-error { border-left-color: var(--pgm-error); }
.agent-proposal.is-blocked { border-left-color: var(--pgm-warn); background: var(--pgm-soft); }
.agent-proposal.is-adopted { border-left-color: var(--pgm-line); opacity: .8; }
.agent-proposal-main { display: flex; gap: .75rem; align-items: flex-start; }
.agent-no { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; border-radius: 999px; background: var(--pgm-brand); color: var(--pgm-brand-ink); font-weight: 700; }
.agent-what, .agent-when { margin: 0; }
.agent-when { color: var(--pgm-muted); font-size: .92rem; }
.agent-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.agent-questions { display: grid; gap: .75rem; }
.agent-question { border: 1px solid var(--pgm-line); border-radius: var(--pgm-radius-sm); padding: .6rem .9rem; }
.agent-question legend { font-weight: 600; padding: 0 .3rem; }
.agent-options { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.agent-busy { background: var(--pgm-soft); display: flex; align-items: center; gap: .6rem; }
.spinner { width: 1rem; height: 1rem; border: 2px solid var(--pgm-line); border-top-color: var(--pgm-brand); border-radius: 50%; animation: pgm-spin .8s linear infinite; }
@keyframes pgm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.agent-close { justify-self: start; }

/* --- M5: Kontrolle ------------------------------------------------------------------------------------- */
.control-jump { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; }
.control-jump a { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--pgm-touch); }
.control-group { margin: 1rem 0 .4rem; font-size: 1rem; }
