/* P2W CRM – Gestaltung nach dem P2W Corporate Design Manual (Ausgabe 01 · 2026):
   Signalorange als einzige Schmuckfarbe, Graphit für Text und Navigation, viel Weiß/Nebel.
   Schriften: Barlow Condensed (Überschriften, Schaltflächen, Navigation), Barlow (Text),
   IBM Plex Mono (Zahlen, Nummern, Labels). Rundungen höchstens 2 px.
   Zum Anpassen nur die Werte im Block "Marke" ändern. */

@font-face { font-family: 'Barlow'; font-style: normal; font-display: swap; font-weight: 400; src: url('/static/fonts/barlow-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 400; src: url('/static/fonts/barlow-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 500; src: url('/static/fonts/barlow-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 500; src: url('/static/fonts/barlow-latin-ext-500-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 600; src: url('/static/fonts/barlow-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 600; src: url('/static/fonts/barlow-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; }
@font-face { font-family: 'Barlow'; font-style: normal; font-display: swap; font-weight: 700; src: url('/static/fonts/barlow-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: 'Barlow'; font-style: normal; font-display: swap; font-weight: 700; src: url('/static/fonts/barlow-latin-ext-700-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: 'Barlow Condensed'; font-style: normal; font-display: swap; font-weight: 600; src: url('/static/fonts/barlow-condensed-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: 'Barlow Condensed'; font-style: normal; font-display: swap; font-weight: 600; src: url('/static/fonts/barlow-condensed-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; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-display: swap; font-weight: 700; src: url('/static/fonts/barlow-condensed-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: 'Barlow Condensed'; font-style: normal; font-display: swap; font-weight: 700; src: url('/static/fonts/barlow-condensed-latin-ext-700-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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url('/static/fonts/ibm-plex-mono-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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url('/static/fonts/ibm-plex-mono-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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url('/static/fonts/ibm-plex-mono-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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url('/static/fonts/ibm-plex-mono-latin-ext-500-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; }

/* hidden gilt immer, auch bei Knöpfen mit display: inline-flex */
[hidden] { display: none !important; }

:root {
  /* Marke (Brandbook S. 06) */
  --brand: #ff7d24;            /* Signalorange, RAL 2008 */
  --brand-strong: #f26a0d;
  --brand-soft: #fff1e6;
  --brand-text: #c25000;       /* Orange als Text, nur auf Weiß */
  --brand-ink: #14161a;        /* Text auf Orange: immer Graphit */
  --nav-bg: #14161a;           /* Graphit */
  --nav-bg-2: #24272d;
  --nav-fg: #d5d8dc;
  --nav-muted: #8a9098;        /* Stahl, nur auf Graphit */

  /* Oberfläche */
  --bg: #fafaf8;               /* Nebel */
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #f1f0ec;
  --line: #e4e3de;             /* Kontur */
  --line-strong: #cfcdc6;
  --text: #14161a;
  --text-2: #3a3e45;
  --muted: #61666e;
  --link: #c25000;
  --focus: #ff7d24;

  /* Status */
  --great: #2f6b4f; --great-bg: #e6f0eb;   /* Verfügbarkeitsgrün aus dem Brandbook */
  --good: #4f7a3a;  --good-bg: #eef3e6;
  --neutral: #5b6068; --neutral-bg: #efeeea;
  --bad: #a85a00;   --bad-bg: #fbf0e1;
  --worst: #b3261e; --worst-bg: #fbe9e7;
  --info: #2d5b86;  --info-bg: #e7eef5;

  --radius: 2px;
  --radius-sm: 2px;
  --shadow: none;
  --shadow-lg: 0 8px 24px -12px rgba(20, 22, 26, .3);
  --nav-w: 216px;

  --font-head: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  font-family: 'Barlow', Arial, system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: inherit; }
a.link, .link { color: var(--link); text-decoration: none; }
a.link:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1rem; margin: 0 0 .9rem; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: .9rem; margin: 0 0 .5rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 1rem; }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; stroke-width: 1.9; }
.icon.sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--nav-bg) var(--nav-w), transparent var(--nav-w)); }
.nav { background: var(--nav-bg); color: var(--nav-fg); padding: 18px 14px 26px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand-link { display: flex; align-items: center; gap: .7rem; padding: 2px 8px 22px; text-decoration: none; color: #fff; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--brand); color: var(--brand-ink); font-weight: 850; border-radius: 2px; font-size: .9rem; letter-spacing: -.02em;  }
.brand-text { line-height: 1.15; }
.brand-text b { display: block; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: .7rem; color: var(--nav-muted); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--nav-muted); font-weight: 650; padding: 16px 10px 6px; }
.nav a.item { display: flex; align-items: center; gap: .7rem; padding: 9px 10px; border-radius: 2px; text-decoration: none; color: var(--nav-fg); font-weight: 520; margin-bottom: 2px; position: relative; transition: background .12s, color .12s; }
.nav a.item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.item.active { background: var(--nav-bg-2); color: #fff; }
.nav a.item.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0; background: var(--brand); }
.nav a.item.active .icon { color: var(--brand); }
.nav .count { margin-left: auto; background: var(--worst); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 2px; padding: 1px 7px; }
.nav .spacer { flex: 1; min-height: 16px; }
.nav-user { display: flex; align-items: center; gap: .65rem; padding: 12px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .07); }
.nav-user .who { line-height: 1.2; min-width: 0; flex: 1; }
.nav-user .who b { color: #fff; display: block; font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .who span { font-size: .74rem; color: var(--nav-muted); }
.nav-user form { margin: 0; }
.nav-user button { background: none; border: 0; color: var(--nav-fg); cursor: pointer; padding: 6px; border-radius: 2px; }
.nav-user button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.crumbs { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topbar .search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.topbar .search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .search input { width: 100%; padding-left: 38px; background: var(--surface-2); border-color: var(--line); height: 38px; }
.topbar .search input:focus { background: #fff; }
.topbar .quick { position: relative; }
.topbar .quick summary { list-style: none; }
.topbar .quick summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; z-index: 30; }
.menu a { display: flex; align-items: center; gap: .6rem; padding: 8px 10px; border-radius: 2px; text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--surface-3); }
.menu .icon { color: var(--muted); }
.avatar-btn { display: grid; place-items: center; text-decoration: none; }

.main { padding: 24px 28px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Karten und Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: .6rem; margin: -2px 0 14px; }
.card-head h2 { margin: 0; }
.card-head .more { margin-left: auto; font-size: .82rem; font-weight: 600; color: var(--link); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.card-head .more:hover { text-decoration: underline; }
.card.flush .card-head { padding: 16px 20px 0; margin: 0 0 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr); align-items: start; }
.grid-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; display: flex; gap: 14px; align-items: flex-start; transition: box-shadow .15s, transform .15s; min-width: 0; }
a.kpi:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kpi .ic { width: 40px; height: 40px; border-radius: 2px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.kpi .ic.y { background: var(--brand-soft); color: var(--brand-text); }
.kpi .ic.g { background: var(--great-bg); color: var(--great); }
.kpi .ic.b { background: var(--info-bg); color: var(--info); }
.kpi .ic.r { background: var(--worst-bg); color: var(--worst); }
.kpi .v { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi .t { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.kpi.warn .v { color: var(--worst); }
.kpi.compact { padding: 12px 14px; }
.kpi.compact .v { font-size: 1.15rem; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.plain td { padding: 9px 4px; }
table.plain tr:hover td { background: none; }
.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--link); }
.cell-entity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-entity .meta { min-width: 0; }
.cell-entity .meta .sub { font-size: .78rem; color: var(--muted); }

/* ---------- Avatare ---------- */
.avatar { width: 34px; height: 34px; border-radius: 2px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .78rem; flex: none; letter-spacing: .02em; }
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; border-radius: 2px; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.35rem; border-radius: 2px; }
.avatar.user { background: var(--brand); color: var(--brand-ink); }

/* ---------- Formulare ---------- */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s; }
input, select { height: 38px; }
input[type=file] { height: auto; padding: 7px; }
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #a9a69d; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(255, 125, 36, .2); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; accent-color: var(--nav-bg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.form-row-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row-inline > * { flex: 1 1 150px; }
.filters { padding: 14px 16px; margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.form-actions { display: flex; gap: .5rem; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
p { margin: 0 0 .9rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 38px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); border-radius: var(--radius-sm); padding: 0 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-3); border-color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.dark { background: var(--nav-bg); border-color: var(--nav-bg); color: #fff; }
.btn.dark:hover { background: var(--nav-bg-2); }
.btn.danger { color: var(--worst); border-color: #f2c2c4; }
.btn.danger:hover { background: var(--worst-bg); }
.btn.small { height: 30px; padding: 0 10px; font-size: .8rem; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.small.icon-only { width: 30px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.inline { display: inline; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 2px; padding: 3px; gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 2px; text-decoration: none; font-weight: 600; font-size: .84rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- Rückmeldungen ---------- */
.flash { padding: 11px 14px; border-radius: 2px; margin-bottom: 18px; font-weight: 550; display: flex; gap: .55rem; align-items: center; border: 1px solid transparent; }
.flash.ok { background: var(--great-bg); color: var(--great); border-color: #bfe8d1; }
.flash.error, .error-box { background: var(--worst-bg); color: var(--worst); border: 1px solid #f6c7c9; padding: 11px 14px; border-radius: 2px; margin-bottom: 16px; }

/* ---------- Pills und Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 2px; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; line-height: 1.6; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.great { background: var(--great-bg); color: var(--great); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.worst { background: var(--worst-bg); color: var(--worst); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-text); }
.badge.outline { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.abc { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 2px; font-weight: 800; font-size: .74rem; background: var(--surface-3); color: var(--muted); }
.abc.A { background: var(--brand); color: var(--brand-ink); }
.abc.B { background: var(--brand-soft); color: var(--brand-text); border: 1px solid #ffc9a3; }
.abc.C { background: var(--surface-3); color: var(--text-2); }
.status-Gesperrt, .overdue { color: var(--worst); font-weight: 650; }
.blocked-banner { background: var(--worst-bg); color: var(--worst); border: 1px solid #f6c7c9; border-radius: 2px; padding: 11px 14px; font-weight: 600; margin-bottom: 16px; display: flex; gap: .55rem; align-items: center; }

/* Bewertung 1–5 */
.dots { display: inline-flex; gap: 2px; vertical-align: middle; }
.dots i { width: 7px; height: 14px; border-radius: 1px; background: #e4e3de; display: block; }
.dots.t-great i.on { background: var(--great); }
.dots.t-good i.on { background: #6f9a4f; }
.dots.t-neutral i.on { background: #8a9098; }
.dots.t-bad i.on { background: #d9822b; }
.dots.t-worst i.on { background: var(--worst); }
.rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating label { margin: 0; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 2px; padding: 10px 8px; font-weight: 600; background: #fff; text-align: center; font-size: .8rem; color: var(--text-2); transition: all .12s; }
.rating label b { display: block; font-size: 1.15rem; line-height: 1.2; }
.rating label:hover { border-color: #8a9098; }
.rating input:checked + label { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.rating input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.rating .r5 b, .rating input:checked + .r5 { color: var(--great); } .rating input:checked + .r5 { background: var(--great-bg); }
.rating .r4 b, .rating input:checked + .r4 { color: var(--good); } .rating input:checked + .r4 { background: var(--good-bg); }
.rating .r3 b, .rating input:checked + .r3 { color: var(--neutral); } .rating input:checked + .r3 { background: var(--neutral-bg); }
.rating .r2 b, .rating input:checked + .r2 { color: var(--bad); } .rating input:checked + .r2 { background: var(--bad-bg); }
.rating .r1 b, .rating input:checked + .r1 { color: var(--worst); } .rating input:checked + .r1 { background: var(--worst-bg); }

/* ---------- Kundenprofil ---------- */
.profile { padding: 0; overflow: hidden; margin-bottom: 16px; }
.profile-top { display: flex; gap: 18px; align-items: center; padding: 22px 24px 18px; flex-wrap: wrap; background: #fff; }
.profile-top .name { flex: 1; min-width: 240px; }
.profile-top .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.profile-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); }
.profile-facts > div { padding: 12px 24px; border-right: 1px solid var(--line); min-width: 0; }
.profile-facts > div:last-child { border-right: 0; }
.profile-facts .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.profile-facts .v { font-weight: 650; font-size: 1.05rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.profile-facts .v.warn { color: var(--worst); }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-top: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 12px 10px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--brand); }
.tabs .n { background: var(--surface-3); color: var(--text-2); border-radius: 2px; padding: 0 7px; font-size: .72rem; }
dl.facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .82rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 0 0 18px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-bg); color: var(--neutral); box-shadow: 0 0 0 4px #fff; position: relative; }
.tl-icon .icon { width: 15px; height: 15px; }
.tl-icon.great { background: var(--great-bg); color: var(--great); }
.tl-icon.good { background: var(--good-bg); color: var(--good); }
.tl-icon.bad { background: var(--bad-bg); color: var(--bad); }
.tl-icon.worst { background: var(--worst-bg); color: var(--worst); }
.tl-icon.appt { background: var(--info-bg); color: var(--info); }
.tl-body { border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; background: #fff; }
.tl-head { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tl-title { font-weight: 650; }
.tl-notes { margin: .4rem 0 0; white-space: pre-wrap; color: var(--text-2); }
.tl-foot { font-size: .78rem; color: var(--muted); margin-top: .5rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; }
.tl-foot span { display: inline-flex; gap: 4px; align-items: center; }
.contact-card { border: 1px solid var(--line); border-radius: 2px; padding: 12px; display: flex; gap: 12px; background: #fff; }
.contact-card + .contact-card { margin-top: 10px; }
.contact-card .name { font-weight: 650; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.contact-card .lines { font-size: .84rem; margin-top: 4px; display: grid; gap: 2px; }
.contact-card .lines a { display: inline-flex; gap: 6px; align-items: center; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.contacts-grid .contact-card + .contact-card { margin-top: 0; }
.bar { height: 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--great); border-radius: 2px; }
details.add { margin-top: 12px; }
details.add summary { cursor: pointer; font-weight: 600; color: var(--link); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.add summary::-webkit-details-marker { display: none; }
details.add[open] summary { margin-bottom: 14px; }
.composer summary { width: 100%; padding: 4px 0; font-size: .95rem; color: var(--text); }
.composer summary .ph { flex: 1; color: var(--muted); font-weight: 500; border: 1px solid var(--line-strong); border-radius: 2px; padding: 9px 12px; background: var(--surface-2); }
.composer[open] summary .ph { display: none; }

/* ---------- Kalender ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; box-shadow: var(--shadow); }
.day { background: var(--surface); min-height: 420px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.day.weekend { background: var(--surface-2); }
.day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.day-head .dn { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.day-head .dd { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.day.today .dd { background: var(--brand); color: var(--brand-ink); border-radius: 2px; padding: 0 7px; }
.day-head a { text-decoration: none; color: var(--muted); border-radius: 2px; width: 24px; height: 24px; display: grid; place-items: center; }
.day-head a:hover { background: var(--surface-3); color: var(--text); }
.appt { display: block; text-decoration: none; border-left: 3px solid var(--info); background: var(--info-bg); padding: 6px 8px; border-radius: 2px; font-size: .78rem; line-height: 1.35; }
.appt:hover { filter: brightness(.97); }
.appt.t-baustelle { border-color: var(--brand); background: var(--brand-soft); }
.appt.t-mietpark { border-color: var(--nav-bg); background: var(--surface-3); }
.appt.erledigt { border-color: var(--great); background: var(--great-bg); }
.appt.abgesagt { border-color: #a9a69d; background: var(--neutral-bg); text-decoration: line-through; }
.appt b { display: block; font-weight: 650; }
.appt .tm { font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fu { font-size: .76rem; border: 1px dashed var(--brand); background: var(--brand-soft); padding: 5px 8px; border-radius: 2px; text-decoration: none; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Planungsboard (Mitarbeiter × Tage) */
.planner { overflow-x: auto; }
.planner table { table-layout: fixed; min-width: 1100px; }
.planner th, .planner td { border-right: 1px solid var(--line); padding: 6px; vertical-align: top; }
.planner th:last-child, .planner td:last-child { border-right: 0; }
.planner th { text-align: center; text-transform: none; letter-spacing: 0; font-size: .74rem; padding: 8px 4px; }
.planner th .dd { display: block; font-size: 1rem; color: var(--text); font-weight: 700; }
.planner th.today .dd { color: var(--brand-ink); background: var(--brand); border-radius: 2px; display: table; margin: 1px auto 0; padding: 0 6px; }
.planner th.we, .planner td.we { background: var(--surface-2); }
.planner th.who, .planner td.who { width: 190px; text-align: left; vertical-align: middle; }
.planner td { height: 74px; }
.planner .appt, .planner .fu { margin-bottom: 4px; font-size: .72rem; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner .appt .tm { display: block; }

/* ---------- Pipeline-Board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--surface-3); border-radius: var(--radius); padding: 10px; min-height: 420px; transition: background .12s; }
.col.drop { background: var(--brand-soft); outline: 2px dashed var(--brand-strong); outline-offset: -2px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.col-head .t { font-weight: 700; display: flex; gap: 7px; align-items: center; }
.col-head .t::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #8a9098); }
.col-head .n { background: #fff; border-radius: 2px; padding: 0 8px; font-size: .74rem; color: var(--muted); font-weight: 650; }
.col-head .sum { font-weight: 650; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.col[data-stage=Anfrage] { --c: #8a9098; }
.col[data-stage=Angebot] { --c: var(--info); }
.col[data-stage=Verhandlung] { --c: var(--brand); }
.col[data-stage=Gewonnen] { --c: var(--great); }
.col[data-stage=Verloren] { --c: var(--worst); }
.deal { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; border-top: 3px solid var(--c, #8a9098); }
.deal:hover { box-shadow: var(--shadow-lg); }
.deal.dragging { opacity: .5; }
.deal .t { font-weight: 650; display: block; color: var(--text); text-decoration: none; line-height: 1.35; }
.deal .t:hover { color: var(--link); }
.deal .c { font-size: .8rem; margin-top: 3px; }
.deal .c a { color: var(--text-2); text-decoration: none; }
.deal .eq { font-size: .76rem; color: var(--muted); display: flex; gap: 5px; align-items: center; margin-top: 6px; }
.deal .badge { white-space: normal; margin-top: 6px; }
.deal .m { font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.deal .m b { color: var(--text); font-size: .86rem; font-variant-numeric: tabular-nums; }

/* ---------- Import ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--muted); font-size: .86rem; }
.steps span i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-style: normal; font-size: .76rem; }
.steps span.on { color: var(--text); }
.steps span.on i { background: var(--brand); color: var(--brand-ink); }
.steps span.done i { background: var(--great); color: #fff; }
.steps .sep { width: 28px; height: 1px; background: var(--line-strong); align-self: center; }
.map-table select { min-width: 230px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stats .kpi { min-width: 150px; flex: 0 1 auto; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface-2); }
.dropzone .icon { width: 32px; height: 32px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { background: var(--nav-bg); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--band); }
.login-art h1 { font-size: 2.3rem; line-height: 1.15; max-width: 460px; letter-spacing: -.03em; }
.login-art h1 em { font-style: normal; color: var(--brand); }
.login-art p { color: var(--nav-fg); max-width: 440px; font-size: 1rem; }
.login-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: #dbe3ec; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li .icon { color: var(--brand); }
.login-form { display: grid; place-items: center; padding: 32px; }
.login { width: 100%; max-width: 380px; }
.login h2 { font-size: 1.5rem; margin-bottom: 4px; letter-spacing: -.02em; }
.login .brand-link { padding: 0; color: #fff; }

.chart-box { position: relative; height: 270px; }
.chart-box.tall { height: 360px; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
.empty .icon { display: block; margin: 0 auto 6px; width: 26px; height: 26px; color: #cfcdc6; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow .sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-chip { width: 46px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; line-height: 1.1; background: #fff; }
.date-chip .m { background: var(--nav-bg); color: #fff; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; font-weight: 650; }
.date-chip .d { font-weight: 750; font-size: 1.05rem; padding: 3px 0 0; }
.date-chip .t { font-size: .66rem; color: var(--muted); padding-bottom: 3px; }


/* ---------- Brandbook-Schicht: Typografie, Kanten, Diagonalband ---------- */
:root { --band: repeating-linear-gradient(-45deg, var(--brand) 0 14px, transparent 14px 26px); }
h1, h2, .brand-text b, .login h2, .kpi .v, .profile-top h1, .card-head h2, .col-head .t, .day-head .dd, .planner th .dd, .tl-title {
  font-family: var(--font-head);
}
h1 { font-size: 2.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; }
h2 { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
h3 { font-size: 1rem; font-weight: 600; }
th, .nav-section, .form-section, .profile-facts .l, .day-head .dn, .date-chip .m, .brand-text span, .kpi .l, .eyebrow, .tabs .n {
  font-family: var(--font-mono); font-weight: 500; letter-spacing: .06em;
}
th { font-size: .72rem; }
.num, td.num, .kpi .v, .profile-facts .v.mono, .mono, .date-chip .t, .appt .tm, .deal .m b, .col-head .sum, .kingbill-nr, input[type=tel] { font-variant-numeric: tabular-nums; }
.mono, .kingbill-nr, td.mono { font-family: var(--font-mono); font-size: .86em; }
.eyebrow { color: var(--brand-text); text-transform: uppercase; font-size: .74rem; letter-spacing: .14em; display: block; margin-bottom: 4px; }
.page-head .sub { font-family: var(--font-mono); font-size: .8rem; }
.kpi .v { font-size: 2rem; font-weight: 700; letter-spacing: 0; }
.kpi .l { font-size: .72rem; text-transform: uppercase; }
.kpi { border-top: 3px solid var(--nav-bg); }
.kpi.warn { border-top-color: var(--worst); }
a.kpi:hover { transform: none; border-color: var(--text); box-shadow: none; }
.card { box-shadow: none; }
.card-head h2 { font-size: 1.15rem; }

.btn { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .95rem; border-color: var(--text); border-width: 1.5px; }
.btn.small { font-size: .82rem; }
.btn.primary { color: var(--brand-ink); }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--worst); }
.segmented { border-radius: 2px; padding: 0; gap: 0; border: 1.5px solid var(--text); background: #fff; }
.segmented a { border-radius: 0; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; color: var(--text-2); }
.segmented a.on { background: var(--nav-bg); color: #fff; box-shadow: none; }

.nav { border-right: 0; }
.nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--band); }
.brand-link { gap: .75rem; padding: 0 6px 18px; }
.brand-logo { width: 48px; height: 48px; flex: none; display: block; }
.brand-text b { font-size: 1.25rem; text-transform: uppercase; letter-spacing: .02em; }
.nav a.item { font-family: var(--font-head); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; font-size: 1.02rem; border-radius: 0; }
.nav a.item.active { background: var(--nav-bg-2); }
.nav a.item.active::before { left: -14px; width: 4px; top: 0; bottom: 0; }
.nav .count { font-family: var(--font-mono); background: var(--brand); color: var(--brand-ink); }
.nav-user { padding-bottom: 14px; }

.topbar { background: #fff; backdrop-filter: none; border-bottom: 1px solid var(--line); }
.crumbs { font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.crumbs b { color: var(--brand-text); font-weight: 500; }

.badge { border-radius: 2px; font-weight: 600; }
.badge.outline { border-color: var(--line-strong); }
.abc { font-family: var(--font-mono); border-radius: 2px; }
.avatar { border-radius: 2px; font-family: var(--font-head); font-size: .9rem; }
.avatar.sm { font-size: .8rem; }
.avatar.lg { font-size: 1.6rem; }
.avatar.round { border-radius: 50%; }
.tabs a { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .04em; font-size: 1rem; border-bottom-width: 3px; }
.tabs a.on { color: var(--text); }
.date-chip .d { font-family: var(--font-head); font-size: 1.3rem; }
.day.today .dd, .planner th.today .dd { border-radius: 2px; }
.login-art h1 { font-size: 3.4rem; text-transform: uppercase; }
.login-art h1 em { color: var(--brand); }
.login-art .brand-logo { width: 96px; height: 96px; }
.login h2 { font-size: 2rem; text-transform: uppercase; }
.flash, .error-box, .blocked-banner { border-radius: 2px; }
a.link, .link, .card-head .more { color: var(--link); }
.band { height: 10px; background: var(--band); }

table.so-table td.eq { min-width: 230px; }
table.so-table td.site { min-width: 170px; }


/* ---------- Kundenkarte im SuperOffice-Stil ---------- */
.so-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); margin-bottom: 16px; }
.so-head { display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.so-title { flex: 1; min-width: 260px; }
.so-title h1 { font-size: 2rem; }
.so-title .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.so-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: center; }
.so-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.so-col { padding: 16px 22px; border-right: 1px solid var(--line); min-width: 0; }
.so-col:last-child { border-right: 0; }
.so-label { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-text); margin: 0 0 10px; display: flex; gap: 6px; align-items: baseline; }
.so-label .muted { color: var(--muted); }
dl.so-fields { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; margin: 0; font-size: .92rem; }
dl.so-fields dt { color: var(--muted); font-size: .8rem; padding-top: 2px; }
dl.so-fields dd { margin: 0; overflow-wrap: anywhere; }
.so-contact { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.so-contact:last-child { border-bottom: 0; }
.so-contact .grow { flex: 1; min-width: 0; line-height: 1.3; }
.so-facts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--surface-2); }
.so-facts > div { padding: 10px 16px; border-right: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.so-facts > div:last-child { border-right: 0; }
.so-facts .l { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.so-facts .v { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-facts .v.warn { color: var(--worst); }
.on-hire { font-family: var(--font-mono); font-size: .7rem; font-weight: 500; color: var(--brand-text); }

.so-archive .tabs { border-top: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); padding: 0 10px; }
.so-archive .tabs a { padding: 13px 12px 11px; }
.so-archive .tabs a.on { background: #fff; }
.tabs .n.warn { background: var(--worst); color: #fff; }
.panel { padding: 0 0 6px; }
.panel-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-bar > .btn { margin-left: auto; }
.panel > .empty { padding: 36px 18px; }
.panel > details.add { padding: 0 18px 14px; }
.mini-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.mini-stats > div { display: flex; flex-direction: column; }
.mini-stats .l { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-stats b { font-family: var(--font-head); font-size: 1.3rem; line-height: 1.1; }

table.so-table th { background: #fff; border-bottom: 2px solid var(--text); }
table.so-table td { padding: 9px 12px; vertical-align: top; }
table.so-table th:first-child, table.so-table td:first-child { padding-left: 18px; }
table.so-table th:last-child, table.so-table td:last-child { padding-right: 18px; }
table.so-table tfoot td { border-top: 2px solid var(--text); border-bottom: 0; background: var(--surface-2); }
table.so-table tr.done td { color: var(--muted); }
table.so-table tr.done b { font-weight: 500; text-decoration: line-through; text-decoration-color: var(--line-strong); }
.notes-table .note-cell { min-width: 280px; max-width: 520px; }
.notes-table .tl-notes { margin: 3px 0 0; font-size: .9rem; }
.note-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.note-meta:empty { display: none; }
.note-meta span { display: inline-flex; gap: 4px; align-items: center; }
.ch { display: inline-flex; gap: 5px; align-items: center; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; }

.rental-layout { display: block; }
.rental-side { border-top: 1px solid var(--line); padding: 14px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 24px; }
.rental-side .so-label { grid-column: 1 / -1; }
.top-eq { margin-bottom: 12px; }
.bar.brand > span { background: var(--brand); }
.bar { border-radius: 0; height: 6px; margin: 3px 0 2px; }
.bar > span { border-radius: 0; }

details.add.composer { margin: 0; border-bottom: 1px solid var(--line); }
details.add.composer summary { padding: 12px 18px; display: flex; gap: 10px; align-items: center; width: 100%; }
.composer summary .ph { border-radius: 2px; }
details.add.composer[open] summary { margin: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.composer[open] summary::after { content: 'Anruf / Notiz erfassen'; font-family: var(--font-head); text-transform: uppercase; font-weight: 700; font-size: 1.1rem; flex: 1; }
.composer[open] summary .btn { display: none; }
.composer-form { padding: 16px 18px 4px; background: #fff; }
.composer .form-actions { border-top: 0; padding-top: 4px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span2 { grid-column: span 2; }
.label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.hint .icon { color: var(--brand-text); }

@media (max-width: 1250px) {
  .so-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .so-facts > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .so-body { grid-template-columns: 1fr 1fr; }
  .so-contacts { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}


/* ---------- Wertigkeit, Hauptansprechpartner ---------- */
.so-meta { display: flex; gap: 10px 28px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.meta-item { display: flex; align-items: center; gap: 10px; }
.meta-item > .l { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.primary-form { margin: 0; }
.primary-form select { height: 32px; padding: 4px 8px; width: auto; max-width: 280px; font-weight: 600; }
.stars { display: inline-flex; gap: 1px; color: #d6d4cd; font-size: 1rem; line-height: 1; letter-spacing: 0; }
.stars i { font-style: normal; }
.stars i.on, .stars.sm { color: var(--brand); }
.stars.sm { font-size: .78rem; }
.stars.edit { align-items: center; margin: 0; }
.stars.edit button { background: none; border: 0; padding: 0 1px; font-size: 1.35rem; line-height: 1; color: #d6d4cd; cursor: pointer; transition: transform .1s, color .1s; }
.stars.edit button.on { color: var(--brand); }
.stars.edit:hover button { color: var(--brand); }
.stars.edit button:hover ~ button { color: #d6d4cd; }
.stars.edit button:hover { transform: scale(1.15); }
.stars-label { font-size: .8rem; color: var(--muted); margin-left: 8px; }

/* ---------- Alle Aktivitäten ---------- */
.filter-chips a { font-size: .82rem; padding: 5px 10px; }
table.all-table tr.group-row td { background: var(--surface-2); font-family: var(--font-head); text-transform: uppercase; font-weight: 700; letter-spacing: .03em; padding: 8px 18px; border-bottom: 1px solid var(--line); }
table.all-table tr.empty-row td { padding: 12px 18px; }
.kind-ic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 2px; background: var(--surface-3); color: var(--text-2); }
.kind-ic.appt { background: var(--info-bg); color: var(--info); }
.kind-ic.appt.past { background: var(--surface-3); color: var(--muted); }
.kind-ic.fu { background: var(--brand-soft); color: var(--brand-text); }
.kind-ic.fu.late { background: var(--worst-bg); color: var(--worst); }
.kind-ic.call { background: var(--nav-bg); color: #fff; }

/* ---------- Schnellsuche ---------- */
.nav button.item { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; display: flex; align-items: center; gap: .7rem; padding: 9px 10px; color: var(--nav-fg); font-family: var(--font-head); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; font-size: 1.02rem; margin-bottom: 6px; border: 1px solid rgba(255, 255, 255, .12); }
.nav button.item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.item kbd { margin-left: auto; }
kbd { font-family: var(--font-mono); font-size: .66rem; border: 1px solid currentColor; opacity: .6; padding: 1px 5px; border-radius: 2px; text-transform: none; letter-spacing: 0; }
.qs-backdrop { position: fixed; inset: 0; background: rgba(20, 22, 26, .45); z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.qs-backdrop[hidden] { display: none; }
.qs { width: 100%; max-width: 620px; background: #fff; border-top: 4px solid var(--brand); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); }
.qs-input { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.qs-input .icon { color: var(--muted); }
.qs-input input { border: 0; height: 42px; font-size: 1.1rem; padding: 0; box-shadow: none; }
.qs-input input:focus { box-shadow: none; }
.qs-results { list-style: none; margin: 0; padding: 6px 0; max-height: 52vh; overflow-y: auto; }
.qs-group { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-text); padding: 8px 16px 4px; }
.qs-item { padding: 8px 16px; cursor: pointer; border-left: 3px solid transparent; }
.qs-item.sel { background: var(--surface-3); border-left-color: var(--brand); }
.qs-sub { display: block; font-size: .8rem; color: var(--muted); }
.qs-hint { padding: 14px 16px; color: var(--muted); font-size: .9rem; }
.qs-foot { padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ---------- Wiedervorlagen-Leiste rechts ---------- */
.fu-toggle .count { font-style: normal; font-family: var(--font-mono); background: var(--worst); color: #fff; font-size: .7rem; padding: 0 6px; margin-left: 2px; }
.fu-toggle[aria-expanded="true"] { background: var(--nav-bg); color: #fff; border-color: var(--nav-bg); }
.shell.drawer-open { grid-template-columns: var(--nav-w) minmax(0, 1fr) 300px; }
.drawer { background: #fff; border-left: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); border-top: 4px solid var(--brand); }
.drawer-head h2 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 1.2rem; }
.drawer-filters { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.drawer-filters .segmented a { font-size: .8rem; padding: 5px 10px; }
.drawer-filters select { height: 32px; padding: 4px 8px; font-size: .85rem; }
.drawer-nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.fu-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.fu-day { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 16px 4px; background: #fff; position: sticky; top: 0; }
.fu-day.late { color: var(--worst); }
.fu-item { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.fu-item.late { border-left-color: var(--worst); }
.fu-item.current { background: var(--brand-soft); border-left-color: var(--brand); }
.fu-item > a { flex: 1; min-width: 0; text-decoration: none; color: var(--text); line-height: 1.3; }
.fu-item > a b { font-weight: 650; }
.fu-sub { display: block; font-size: .84rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-meta { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-actions { display: flex; gap: 4px; }
.fu-empty { padding: 20px 16px; color: var(--muted); }
.main.loading { opacity: .5; transition: opacity .1s; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--nav-bg); color: #fff; padding: 10px 16px; border-left: 4px solid var(--brand); font-weight: 600; opacity: 0; transition: all .2s; z-index: 120; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-type=error] { border-left-color: var(--worst); }
@media (max-width: 1100px) {
  .shell.drawer-open { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .drawer { position: fixed; right: 0; top: 0; width: min(360px, 92vw); z-index: 60; box-shadow: var(--shadow-lg); }
  .fu-toggle span { display: none; }
}


/* ---------- Kalender (Tag / Woche / Monat wie Outlook) ---------- */
.cal-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
.mini-cal { background: #fff; border: 1px solid var(--line); padding: 8px 10px 10px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-head b { font-family: var(--font-head); text-transform: uppercase; font-size: 1rem; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-grid .dn { font-family: var(--font-mono); font-size: .62rem; color: var(--muted); padding: 2px 0; }
.mini-grid a { font-family: var(--font-mono); font-size: .76rem; text-decoration: none; padding: 4px 0; color: var(--text); position: relative; }
.mini-grid a:hover { background: var(--surface-3); }
.mini-grid a.out { color: #b5b3ac; }
.mini-grid a.range { background: var(--brand-soft); }
.mini-grid a.today { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.mini-grid a.busy::after { content: ''; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; background: var(--nav-bg); }
.cal-users, .cal-outlook, .legend-list { background: #fff; border: 1px solid var(--line); padding: 12px; margin: 0; }
.cal-user { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .88rem; margin: 0 0 6px; cursor: pointer; color: var(--text); }
.cal-user i, .legend-list i { width: 12px; height: 12px; display: inline-block; flex: none; }
.cal-outlook p { margin: 0 0 8px; }
.legend-list { display: flex; flex-direction: column; gap: 6px; }
.legend-list span { display: flex; align-items: center; gap: 8px; }
.lg-appt { background: var(--brand); }
.lg-done { background: var(--great); }
.lg-fu { border: 1px dashed var(--brand); background: var(--brand-soft); }
.hatch { background: repeating-linear-gradient(-45deg, #c9c7c0 0 3px, #f1f0ec 3px 6px); }

.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-size: 1.7rem; margin: 0 6px; }
.cal-views { margin-left: auto; }

.tg { --hour: 52px; background: #fff; border: 1px solid var(--line); }
.tg-head, .tg-allday, .tg-body { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); }
.tg-head { position: sticky; top: 64px; z-index: 6; background: #fff; border-bottom: 1px solid var(--line); }
.tg-day-head { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; text-decoration: none; color: var(--text); border-left: 1px solid var(--line); }
.tg-day-head .dn { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.tg-day-head .dd { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.tg-day-head .mm { font-size: .78rem; color: var(--muted); }
.tg-day-head.today { box-shadow: inset 0 -3px 0 var(--brand); }
.tg-day-head.today .dd { color: var(--brand-text); }
.tg-day-head:hover { background: var(--surface-2); }
.tg-day-head.we, .tg-allday-cell.we, .tg-col.we { background: var(--surface-2); }
.tg-gutter { font-size: .68rem; text-align: right; padding: 4px 6px; }
.tg-allday { border-bottom: 2px solid var(--line-strong); min-height: 34px; }
.tg-allday-cell { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-fu { display: flex; align-items: center; gap: 4px; font-size: .74rem; padding: 2px 6px; text-decoration: none; color: var(--text); background: var(--brand-soft); border: 1px dashed var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-fu.outlook { background: #f1f0ec; border: 1px solid #d6d4cd; color: var(--text-2); }
.tg-body { position: relative; }
.tg-hours { display: grid; grid-template-rows: repeat(var(--hours), var(--hour)); padding: 0; }
.tg-hours span { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); padding: 0 6px; transform: translateY(-7px); }
.tg-hours span:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid var(--line); display: grid; grid-template-rows: repeat(var(--hours), var(--hour)); }
.tg-col.today { background: #fffaf5; }
.tg-slot { border-bottom: 1px solid var(--line); position: relative; }
.tg-slot::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted #eceae4; }
.tg-slot:hover { background: rgba(255, 125, 36, .06); }
.tg-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--worst); z-index: 4; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; background: var(--worst); border-radius: 50%; }
.ev { position: absolute; z-index: 2; overflow: hidden; text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--c, #2d5b86) 14%, #fff); border-left: 4px solid var(--c, #2d5b86); padding: 3px 6px; font-size: .76rem; line-height: 1.25; display: flex; flex-direction: column; gap: 1px; cursor: grab; touch-action: none; -webkit-user-drag: none; user-select: none; box-shadow: 0 0 0 1px #fff; }
.ev:hover { background: color-mix(in srgb, var(--c, #2d5b86) 24%, #fff); z-index: 3; }
.ev.dragging { opacity: .85; box-shadow: var(--shadow-lg); z-index: 5; cursor: grabbing; }
.ev.saved { outline: 2px solid var(--great); }
.ev.erledigt { background: #f3f6f4; border-left-color: var(--great); color: var(--text-2); }
.ev.abgesagt { background: #f4f4f2; border-left-color: #a9a69d; color: var(--muted); text-decoration: line-through; }
.ev.outlook { background: repeating-linear-gradient(-45deg, #f6f5f2 0 6px, #ecebe6 6px 12px); border-left-color: #8a9098; cursor: default; color: var(--text-2); }
.ev-time { font-size: .68rem; color: var(--text-2); }
.ev-title { font-weight: 650; display: flex; gap: 4px; align-items: flex-start; }
.ev-title .icon { width: 12px; height: 12px; flex: none; margin-top: 2px; }
.ev-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.ev-sync { position: absolute; right: 4px; top: 3px; color: var(--muted); }
.ev-sync .icon { width: 11px; height: 11px; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }

.mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); }
.mg-dn { background: #fff; font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
.mg-cell { background: #fff; min-height: 118px; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mg-cell.we { background: var(--surface-2); }
.mg-cell.out { background: #f6f5f2; }
.mg-cell.out .mg-date { color: #b5b3ac; }
.mg-top { display: flex; justify-content: space-between; align-items: center; }
.mg-date { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); padding: 0 4px; }
.mg-cell.today .mg-date { background: var(--brand); color: var(--brand-ink); }
.mg-add { color: var(--muted); opacity: 0; }
.mg-cell:hover .mg-add { opacity: 1; }
.mg-ev { font-size: .74rem; padding: 1px 5px; text-decoration: none; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c, #2d5b86); background: color-mix(in srgb, var(--c, #2d5b86) 12%, #fff); }
.mg-ev.fu { border: 1px dashed var(--brand); background: var(--brand-soft); display: flex; gap: 3px; align-items: center; }
.mg-ev.outlook { border-left-color: #8a9098; background: #f1f0ec; color: var(--text-2); }
.mg-ev.erledigt { opacity: .7; }
.mg-ev.abgesagt { text-decoration: line-through; opacity: .6; }
.mg-more { font-size: .72rem; color: var(--link); text-decoration: none; }
.planner .appt { border-left-color: var(--c, var(--info)); background: color-mix(in srgb, var(--c, #2d5b86) 12%, #fff); }

@media (max-width: 1100px) {
  .cal-shell { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); min-width: 0; }
  .cal-views { margin-left: 0; }
}
@media (max-width: 900px) {
  .cal-main { order: -1; }
  .cal-side .mini-cal, .cal-side .legend-list { display: none; }
  .tg { overflow-x: auto; }
  .tg-head, .tg-allday, .tg-body { min-width: calc(56px + var(--days) * 110px); }
  .tg-head { top: 0; }
}

/* ---------- Seitenleiste eingeklappt (Standard am Rechner) ---------- */
.nav-toggle { display: flex; align-items: center; gap: .7rem; width: 100%; background: none; border: 0; color: var(--nav-muted); cursor: pointer; padding: 8px 10px; font: inherit; font-size: .8rem; }
.nav-toggle:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-toggle .ic-open { display: none; }
@media (min-width: 901px) {
  .shell:not(.nav-wide) { --nav-w: 68px; }
  .shell:not(.nav-wide) .nav { padding: 14px 10px 26px; overflow-x: hidden; }
  .shell:not(.nav-wide) .brand-link { padding: 2px 0 16px; justify-content: center; }
  .shell:not(.nav-wide) .brand-logo { width: 40px; height: 40px; }
  .shell:not(.nav-wide) .brand-text, .shell:not(.nav-wide) .nav a.item span, .shell:not(.nav-wide) .nav button.item span, .shell:not(.nav-wide) .nav button.item kbd, .shell:not(.nav-wide) .nav-user .who, .shell:not(.nav-wide) .nav-user form, .shell:not(.nav-wide) .nav-toggle span { display: none; }
  .shell:not(.nav-wide) .nav-section { font-size: 0; padding: 8px 0 6px; margin: 0 6px 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .shell:not(.nav-wide) .nav a.item, .shell:not(.nav-wide) .nav button.item, .shell:not(.nav-wide) .nav-toggle { justify-content: center; padding: 10px 0; }
  .shell:not(.nav-wide) .nav a.item.active::before { left: -10px; }
  .shell:not(.nav-wide) .nav .count { position: absolute; top: 2px; right: 2px; padding: 0 4px; font-size: .62rem; }
  .shell:not(.nav-wide) .nav-user { justify-content: center; padding: 10px 0 14px; }
  .shell:not(.nav-wide) .nav-toggle .ic-open { display: inline-flex; }
  .shell:not(.nav-wide) .nav-toggle .ic-close { display: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side, .grid-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  .shell { grid-template-columns: 1fr; background: none; }
  .nav { position: sticky; z-index: 25; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 2px; overflow-x: auto; }
  .nav .brand-link { padding: 0 8px 0 0; }
  .nav .brand-text, .nav .nav-section, .nav .spacer, .nav-user, .nav-toggle { display: none; }
  .nav a.item { padding: 9px; margin: 0; }
  .nav a.item span, .nav .count, .nav button.item span, .nav button.item kbd { display: none; }
  .nav button.item { width: auto; margin: 0; border: 0; padding: 9px; }
  .nav a.item.active::before { left: 8px; right: 8px; top: auto; bottom: -8px; width: auto; height: 3px; border-radius: 2px 3px 0 0; }
  .topbar { position: static; padding: 0 16px; height: 56px; }
  .crumbs { display: none; }
  .topbar .search { margin-left: 0; max-width: none; }
  .main { padding: 16px; }
  .grid-2, .grid-3, .form-grid, .form-grid.three, .so-body { grid-template-columns: minmax(0, 1fr); }
  .meta-item { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .primary-form, .primary-form select { max-width: 100%; }
  .form-grid .span2 { grid-column: auto; }
  .so-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .so-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .rating { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-facts > div { border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .profile-top { padding: 18px 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .nav::after { display: none; }
}

/* ---------- Outlook auf "Mein Konto" ---------- */
.outlook-card { margin-bottom: 16px; }
.outlook-card .card-head .badge { margin-left: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.note-box { background: var(--bg, #FAFAF8); border: 1px dashed var(--line); padding: 10px 12px; }
.setup { background: var(--bg, #FAFAF8); border-left: 3px solid var(--brand, #FF7D24); padding: 12px 16px; }
.setup ol { padding-left: 1.2rem; margin: 8px 0; }
.setup li { margin-bottom: 6px; }
.setup code { font-family: var(--font-mono); font-size: .78rem; background: #fff; border: 1px solid var(--line); padding: 0 4px; word-break: break-all; }

/* ---------- Außendienst ---------- */
.field-head { align-items: center; }
.field-head .btn { margin-left: auto; }
.field-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr) 360px; gap: 16px; height: calc(100vh - 170px); min-height: 560px; }
.field-side, .field-tour { display: flex; flex-direction: column; min-height: 0; }
.field-side { overflow: hidden; }
.field-search { padding: 14px 14px 6px; position: relative; }
.field-search .so-label { margin-bottom: 6px; }
.place-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; padding: 0 4px 0 10px; }
.place-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.place-box input { border: 0; box-shadow: none; padding: 9px 0; flex: 1; min-width: 0; outline: none; }
.place-box > .icon { color: var(--muted); }
.place-list { position: absolute; left: 14px; right: 14px; z-index: 1200; background: #fff; border: 1px solid var(--line-strong); list-style: none; margin: 2px 0 0; padding: 4px 0; max-height: 280px; overflow: auto; box-shadow: var(--shadow-lg); }
.place-list li { padding: 7px 12px; cursor: pointer; font-size: .88rem; }
.place-list li.sel, .place-list li:hover { background: var(--brand-soft); }
.field-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.field-row.two > * { flex: 1; min-width: 0; }
.field-row p { margin: 0; }
.field-row select { min-width: 0; }
.field-search .hint { margin: 6px 0 0; }
.field-filters { padding: 6px 14px 10px; border-bottom: 1px solid var(--line); }
.seg { display: flex; border: 1px solid var(--line-strong); }
.seg button { flex: 1; border: 0; background: #fff; padding: 7px 4px; font: 600 .8rem/1 var(--font-head, inherit); text-transform: uppercase; letter-spacing: .02em; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--brand-ink); color: #fff; }
.field-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.field-summary { padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.field-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.field-list li { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.field-list li.current { background: var(--brand-soft); }
.field-list li.empty { display: block; text-align: center; }
.field-list .li-main { flex: 1; min-width: 0; cursor: pointer; }
.field-list .li-main b { font-weight: 650; }
.field-list .li-sub, .field-list .li-meta { display: block; font-size: .78rem; color: var(--muted); }
.field-list .li-meta { font-family: var(--font-mono); font-size: .72rem; }
.field-list .add { width: 28px; height: 28px; flex: none; border: 1px solid var(--line-strong); background: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--text); }
.field-list .add:hover { border-color: var(--brand); color: var(--brand-text); }
.field-list .add.in { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.kind.bestand { color: var(--text-2); }
.kind.potenzial { color: var(--brand-text); }
.badge.bestand { background: #14161a; color: #fff; }
.badge.potenzial { background: var(--brand-soft); color: var(--brand-text); }
.field-missing { padding: 8px 14px; margin: 0; border-top: 1px solid var(--line); }
.field-map-wrap { position: relative; min-height: 0; overflow: hidden; }
.field-map, .tour-map { width: 100%; height: 100%; background: #e9e8e3; }
.field-map.placing, .field-map.placing .leaflet-interactive { cursor: crosshair; }
.map-legend { position: absolute; left: 10px; bottom: 10px; z-index: 500; background: rgba(255,255,255,.94); border: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; transition: opacity .15s; }
.field-map-wrap.pop-open .map-legend { opacity: 0; pointer-events: none; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.map-legend .dot.bestand { background: #14161a; }
.map-legend .dot.potenzial { background: var(--brand); }
.map-legend .dot.due { background: #fff; border: 3px solid #c0392b; }
.pin-home span { display: block; background: var(--brand-ink); color: #fff; font: 700 .72rem/22px var(--font-head, sans-serif); text-align: center; letter-spacing: .05em; border: 2px solid var(--brand); }
.pin-center { background: var(--info); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--info); }
.pin-stop span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 700 .8rem/1 var(--font-mono); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pin-stop.besucht span { background: var(--great); color: #fff; }
.pin-stop.ausgefallen span { background: #8a9098; color: #fff; text-decoration: line-through; }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper { border-radius: 2px; }
.map-pop { font-size: .85rem; line-height: 1.45; min-width: 230px; }
.map-pop .pop-name { font: 700 1.05rem/1.2 var(--font-head, inherit); color: var(--text); text-decoration: none; display: block; margin-bottom: 3px; }
.map-pop .pop-addr { color: var(--muted); margin: 4px 0; }
.pop-kv { display: grid; grid-template-columns: max-content 1fr; gap: 1px 10px; margin: 6px 0; }
.pop-kv dt { color: var(--muted); }
.pop-kv dd { margin: 0; font-weight: 600; }
.pop-note { margin: 4px 0; color: var(--bad); font-size: .78rem; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop-actions .btn { text-decoration: none; }
.field-tour { padding: 14px; overflow-y: auto; }
.field-tour .card-head h2 { display: flex; align-items: center; gap: 6px; }
.field-tour .card-head .badge { margin-left: auto; }
.tour-form p { margin: 0 0 8px; }
.tour-form label { font-size: .78rem; }
.tour-tools { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.tour-stops { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.tour-stops .leg { padding: 3px 0 3px 38px; border-left: 2px dashed var(--line-strong); margin-left: 12px; font-size: .72rem; min-height: 8px; }
.tour-stops .stop { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.tour-stops .num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 700 .8rem/1 var(--font-mono); }
.tour-stops .stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tour-stops .stop-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.tour-stops .stop-main .mono { white-space: nowrap; }
.tour-stops .dur { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.tour-stops .dur input { width: 52px; padding: 3px 4px; height: 28px; text-align: right; }
.tour-stops .stop-btns { display: flex; }
.tour-stops .stop-btns .btn { width: 24px; padding: 0; }
.tour-empty { margin: 10px 0; }
.tour-totals { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; }
.tour-totals div { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
.tour-totals span { color: var(--muted); }
.warn { color: var(--bad); background: var(--bad-bg); padding: 6px 9px; margin: 6px 0; }
.tour-links { display: grid; gap: 6px; margin-top: 10px; }
.btn.gmaps { justify-content: flex-start; height: auto; padding: 8px 12px; flex-wrap: wrap; text-align: left; }
.btn.gmaps .small { flex-basis: 100%; font-family: var(--font-mono); font-size: .7rem; text-transform: none; font-weight: 400; opacity: .8; }
.tour-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Tagesplan */
.tour-head { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.tour-head h1 { margin: 2px 0 12px; }
.tour-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.tour-facts div { display: flex; flex-direction: column; }
.tour-facts span { font: 500 .7rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tour-facts b { font-size: 1.15rem; }
.tour-buttons { display: grid; gap: 8px; align-content: start; }
.tour-buttons .btn-row { margin-top: 4px; }
.danger-text { color: var(--worst); }
.tour-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; margin-top: 16px; align-items: start; }
.tour-map-card { position: sticky; top: 84px; height: calc(100vh - 120px); max-height: 640px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
.tl-time { font-size: .9rem; font-weight: 600; text-align: right; padding-top: 12px; }
.tl-time small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.tl-leg > div { border-left: 2px dashed var(--line-strong); margin-left: 12px; padding: 8px 0 8px 18px; display: flex; align-items: center; gap: 6px; }
.tl-card { background: #fff; border: 1px solid var(--line); padding: 12px 14px; }
.tl-start { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--surface-2); }
.tl-stop .tl-card { border-left: 4px solid var(--brand); }
.tl-stop.besucht .tl-card { border-left-color: var(--great); background: #fbfdfc; }
.tl-stop.ausgefallen .tl-card { border-left-color: #8a9098; opacity: .7; }
.tl-stop:target .tl-card { box-shadow: 0 0 0 2px var(--brand); }
.tl-head { display: flex; gap: 10px; align-items: flex-start; }
.tl-head .num { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 700 .85rem/1 var(--font-mono); }
.tl-stop.besucht .tl-head .num { background: var(--great); color: #fff; }
.tl-name { font: 700 1.15rem/1.2 var(--font-head, inherit); color: var(--text); text-decoration: none; }
.tl-dur { margin-left: auto; white-space: nowrap; }
.tl-info { display: grid; gap: 3px; margin: 10px 0; color: var(--text-2); }
.tl-info > div { display: flex; gap: 6px; align-items: flex-start; }
.tl-info .icon { flex: none; margin-top: 2px; color: var(--muted); }
.tl-note { background: var(--surface-2); padding: 6px 8px; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-actions form { margin: 0; display: inline-flex; gap: 6px; }

@media (max-width: 1250px) {
  .field-shell { grid-template-columns: 300px minmax(0, 1fr); height: auto; }
  .field-side { height: calc(100vh - 170px); min-height: 560px; }
  .field-map-wrap { height: calc(100vh - 170px); min-height: 560px; }
  .field-tour { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .field-shell { grid-template-columns: minmax(0, 1fr); }
  .field-map-wrap { order: -1; height: 55vh; min-height: 320px; }
  .map-legend { font-size: .7rem; padding: 4px 8px; gap: 1px; }
  .map-legend .muted { display: none; }
  .field-side { height: auto; max-height: none; min-height: 0; }
  .field-list { max-height: 60vh; }
  .tour-head, .tour-body { grid-template-columns: minmax(0, 1fr); }
  .tour-map-card { position: static; height: 300px; }
  .timeline li { grid-template-columns: 46px minmax(0, 1fr); gap: 8px; }
}
@media print {
  .nav, .topbar, .tour-buttons, .tl-actions, .drawer, .tour-map-card { display: none !important; }
  .shell { display: block; }
  .tour-body { display: block; }
  .tl-card { break-inside: avoid; }
}

/* Blättern in langen Listen */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 4px; }

/* ---------- Handy: Navigation unten, Listen als Karten, einklappbare Filter ---------- */
.m-only { display: none !important; }
.tour-jump { display: none; }
@media (max-width: 900px) {
  .m-only { display: inline-flex !important; }
  /* Navigation als Leiste am unteren Rand mit Beschriftung */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: calc(60px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); gap: 0; z-index: 40; overflow: hidden; justify-content: space-around; box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .5); }
  .nav .brand-link, .nav button.item.nav-search, .nav a.item:not(.m-tab) { display: none; }
  .nav a.item.m-tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; justify-content: center; padding: 6px 2px; height: 60px; font-size: .64rem; letter-spacing: .01em; text-align: center; }
  .nav a.item.m-tab span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a.item.m-tab .count { display: inline-block; position: absolute; top: 4px; left: calc(50% + 6px); padding: 0 4px; font-size: .6rem; }
  .nav a.item.active::before { left: 25%; right: 25%; top: 0; bottom: auto; height: 3px; border-radius: 0 0 2px 2px; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  /* Kopfzeile: Logo, Suche, Wiedervorlagen, Neu, Konto */
  .topbar { position: sticky; top: 0; height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; gap: 8px; background: var(--nav-bg); border-bottom: 0; backdrop-filter: none; }
  .topbar .m-brand { display: flex !important; flex: none; }
  .topbar .m-brand img { width: 34px; height: 34px; display: block; }
  .topbar .search { flex: 1 1 auto; min-width: 0; }
  .topbar .search input { height: 38px; font-size: 16px; }
  .topbar .fu-toggle, .topbar .quick summary { height: 38px; padding: 0 10px; }
  .topbar .quick summary span { display: none; }
  .topbar .fu-toggle { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
  .topbar .m-account { flex: none; text-decoration: none; }
  .topbar .quick .menu { right: 0; left: auto; }
  /* Eingabefelder mindestens 16px, damit das iPhone nicht hineinzoomt; größere Tippflächen */
  input, select, textarea { font-size: 16px; }
  input, select { height: 44px; }
  .btn { height: 42px; }
  .btn.small { height: 36px; padding: 0 12px; }
  .btn.small.icon-only { width: 36px; }
  .page-head { margin-bottom: 14px; gap: .6rem; }
  .page-head h1 { font-size: 1.7rem; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn.primary { flex: 1 1 auto; }
  /* Kennzahlen zweispaltig */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 8px; flex-direction: column; }
  .kpi .ic { width: 32px; height: 32px; }
  .kpi .v { font-size: 1.3rem; }
  /* Filter eingeklappt, Knopf blendet sie ein */
  .filter-toggle { width: 100%; margin-bottom: 12px; justify-content: flex-start; }
  .filter-toggle .count { margin-left: auto; }
  .filters.m-collapse:not(.open) { display: none; }
  .filters.m-collapse .form-row-inline > div, .filters.m-collapse > div { flex: 1 1 140px !important; }
  /* Tabellen als Karten */
  .table-wrap:has(> .mcards), .card.table-wrap:has(.mcards) { overflow: visible; }
  table.mcards, table.mcards tbody { display: block; width: 100%; }
  table.mcards thead { display: none; }
  table.mcards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
  table.mcards tr:last-child { border-bottom: 0; }
  table.mcards td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; }
  table.mcards td.m-main { flex: 1 1 100%; order: -1; }
  table.mcards td.m-full { flex: 1 1 100%; }
  table.mcards td.m-hide { display: none; }
  table.mcards td.empty { flex: 1 1 100%; }
  table.mcards td[data-label]::before { content: attr(data-label) ' '; color: var(--muted); font-size: .72rem; }
  table.mcards td.m-full .form-row-inline { flex-wrap: wrap; }
  /* Tabellen in der Kundenansicht (Aktivitäten, Miete, Termine …) ebenfalls als Karten */
  .table-wrap:has(> .so-table) { overflow: visible; }
  table.so-table, table.so-table tbody { display: block; width: 100%; }
  table.so-table thead { display: none; }
  table.so-table tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.so-table td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; }
  table.so-table td:empty { display: none; }
  table.so-table td.right { margin-left: auto; }
  table.so-table td.note-cell, table.so-table td:has(.row-link), table.so-table td:has(> b), table.so-table tr.group-row td, table.so-table tr.empty-row td { flex: 1 1 100%; }
  table.so-table tr.group-row { padding: 8px 14px; }
  /* Außendienst: Knopf zur Tour schwebt über der Navigation */
  .tour-jump:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; position: fixed; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 35; background: var(--nav-bg); color: #fff; text-decoration: none; font-weight: 700; padding: 10px 16px; border-radius: 22px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6); border: 2px solid var(--brand); }
  /* Anfragen: eine Spalte fast bildschirmbreit, seitlich wischen */
  .board { grid-template-columns: repeat(5, 84vw); scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 6px; scroll-padding: 0 14px; }
  .board .col { scroll-snap-align: start; }
  .pager { position: static; }
  .pager .small { text-align: center; }
}

/* App installieren (Mein Konto) */
.install-card { margin-bottom: 16px; }
