/* Kern CRM. Hell, Schwarz und Weiß (Inhaber 03.11.2026); Rot nur für Überfälliges. Kein Blau. */
/* Listen, Datensätze, Formulare (S2) */
/* long e-mails or URLs must not widen the grid column at 390 px */
/* Rahmen mit linker Leiste (S2) */
/* Vorgänge (S3): Ampel des nächsten Schritts, Verlustgrund nur bei „Verloren“ */
/* The loss reason only matters for "Verloren": hidden while another phase is selected, without JavaScript. */
/* Phasen-Reiter (S3) */
/* Kanban (S3): eine Spalte je offene Phase; bei 390 px untereinander */
/* Heute (S6): drei Arbeitslisten, bei schmalen Ansichten untereinander. */
/* Suche und Schnellanlage (S7). */
/* Mobile Navigation: ohne JavaScript offen; kleine Bildschirme werden gezielt ergänzt. */
/* Vorhandene Absprachen lesen, Erfassung bei Bedarf öffnen. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --bg: #ffffff; --surface: #ffffff; --stone: #f3f3f1;
  --graphite: #111111; --text: #1d1d1b; --muted: #62645e;
  --signal: #161616; --signal-ink: #ffffff; --signal-deep: #161616;
  --line: #dededa; --sidebar: #232522; --sidebar-text: #eeefe9;
  --sidebar-muted: #b1b6aa; --sidebar-line: #454940;
  --radius: 12px; --font: "Schibsted Grotesk", system-ui, sans-serif;
  --ampel-rot: #c81e1e; --ampel-gelb: #b78300; --ampel-grau: #909589;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--signal-deep); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
button, input[type=submit], .knopf, summary { min-height: 44px; }
button { padding: 10px 16px; cursor: pointer; background: var(--signal); color: var(--signal-ink);
  border: 1px solid transparent; border-radius: 8px; font-weight: 650; }
button:hover, .primaer:hover { filter: brightness(.96); }
button.leise { background: transparent; color: var(--muted); border-color: var(--line); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; max-width: 560px; min-height: 46px; padding: 11px 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
.sprunglink { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 12px 18px;
  background: var(--surface); color: var(--text); transform: translateY(-200%); border: 2px solid var(--signal); border-radius: 8px; }
.sprunglink:focus { transform: none; }
.kopf { padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.marke { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; letter-spacing: -.04em; }
.markenzeichen { display: inline-grid; place-items: center; width: 32px; height: 32px; color: inherit; --klytia-akzent: #E8702A; }
.markenzeichen svg, .auth-brand-mark svg { display: block; width: 100%; height: 100%; }
.mit-leiste { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.leiste { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 18px; background: var(--sidebar); color: var(--sidebar-text); }
.leiste .marke { padding: 4px 0; }
.navigation-inhalt { display: flex; flex: 0 0 100%; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.navigation-schalter { border-color: var(--sidebar-line); background: transparent; color: var(--sidebar-text); }
.navigation-schalter[hidden], .navigation-inhalt[hidden] { display: none; }
.leiste ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.leiste a { display: flex; align-items: center; min-height: 44px; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--sidebar-text); text-decoration: none; }
.leiste a:hover { background: #343831; }
.leiste a[aria-current=page] { background: #41473c; color: #fff; box-shadow: inset 3px 0 var(--sidebar-text); font-weight: 650; }
.leiste svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
.abschnitt { display: none; margin: 22px 12px 5px; color: var(--sidebar-muted); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.globale-suche { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: 100%; margin: 10px 0; }
.globale-suche label { grid-column: 1/-1; color: var(--sidebar-muted); font-size: 12px; }
.leiste .globale-suche input { min-width: 0; max-width: none; background: #30342d; border-color: var(--sidebar-line); color: var(--sidebar-text); }
.leiste .globale-suche input::placeholder { color: #b4baad; }
.globale-suche button { padding: 8px 10px; }
.schnellanlage { width: 100%; margin: 2px 0 10px; }
.schnellanlage-titel { margin: 0; padding: 10px 12px; border: 1px solid var(--sidebar-line); border-radius: 8px; font-weight: 650; }
.leiste .schnellanlage ul { flex-direction: column; padding-top: 5px; }
.abmelden { margin: 0; }
.leiste .abmelden button { color: var(--sidebar-muted); border: 0; padding-left: 12px; }
.arbeitsbereich { min-width: 0; }
.arbeitsplatz-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 62px;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
.konto-hinweis { overflow-wrap: anywhere; text-align: right; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hell-dunkel { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.hell-dunkel:hover { border-color: var(--muted); }
.inhalt { min-width: 0; padding: 28px 20px 48px; overflow-wrap: anywhere; }
h1 { margin: 0 0 10px; color: var(--graphite); font-size: clamp(27px,3vw,36px); font-weight: 700; line-height: 1.18; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { color: var(--graphite); font-size: 19px; line-height: 1.3; letter-spacing: -.025em; }
h3 { margin: 0 0 8px; font-size: 15px; }
.augenbraue { margin: 0 0 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 650; }
.seitenkopf, .kopfzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.seitenkopf { margin-bottom: 32px; }
.seitenkopf .leer { margin: 0; font-size: 14px; }
.kopfzeile h1, .kopfzeile h2 { margin: 0; }
.kopf-aktionen { display: flex; flex-wrap: wrap; gap: 10px; }
.leer, .meta { color: var(--muted); }
.knopf { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 650; }
.knopf:hover { border-color: var(--muted); text-decoration: none; }
.primaer { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.meldungen { list-style: none; margin: 0 0 24px; padding: 0; }
.meldungen li { padding: 12px 16px; background: var(--stone); border-left: 3px solid var(--signal); border-radius: 4px; }
.feld label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.feld input[type=checkbox] { width: 20px; height: 20px; margin-right: 8px; flex: 0 0 auto; }
.feld label:has(input[type=checkbox]) { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.feld { margin: 0 0 20px; }
.formular { max-width: 680px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 28px; }
.errorlist { padding: 10px 14px 10px 30px; color: var(--signal-deep); border-left: 3px solid var(--signal); background: var(--surface); }
.warnung { border: 1px solid var(--signal); background: var(--surface); padding: 16px; border-radius: 8px; margin-bottom: 20px; }
.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tabelle th, .tabelle td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); overflow-wrap: normal; }
.tabelle td:first-child, .tabelle td:nth-child(3), .tabelle td.freitext { overflow-wrap: anywhere; }
.tabelle th { color: var(--muted); font-size: 11px; font-weight: 650; background: var(--stone); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .neben { display: none; }
.felder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0 0 24px; }
.felder dt { color: var(--muted); font-size: 12px; }
.felder dd { min-width: 0; margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; }
.karte { margin-bottom: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.karte p { margin: 6px 0 0; font-size: 14px; }
.karte > a { font-weight: 600; text-decoration: none; }
.karte > a:hover { text-decoration: underline; }
.karte-firma { color: var(--muted); }
.heute-listen, .suchergebnisse { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.heute-listen section, .suchergebnisse section { min-width: 0; }
.arbeitslisten > section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.arbeitslisten h2 { margin: 0 0 20px; font-size: 16px; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.arbeitslisten .karte { background: var(--bg); border-color: transparent; }
.arbeitslisten .leer { font-size: 13px; }
.heute-liste, .suchliste { list-style: none; margin: 0; padding: 0; }
.zahl { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; padding: 2px 7px;
  border-radius: 6px; background: var(--stone); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.reiter, .umschalter, .suchseiten { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.reiter { margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.reiter a, .umschalter a { min-height: 44px; padding: 10px 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.reiter a[aria-current=page], .umschalter a[aria-current=page] { color: var(--text); font-weight: 650; border-bottom-color: var(--signal); }
.kanban { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.spalte { min-width: 0; padding: 14px; border-radius: var(--radius); background: var(--stone); }
.spalte h2 { margin: 0 0 16px; font-size: 14px; }
.ampel { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; }
.ampel-rot { background: var(--ampel-rot); } .ampel-orange { background: var(--signal); }
.ampel-gelb { background: var(--ampel-gelb); } .ampel-grau { background: var(--ampel-grau); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.formular:has(#id_phase option[value=verloren]:not(:checked)) .feld:has(#id_verlustgrund) { display: none; }
.datensatz-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.datensatz-kontext { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-self: start; }
.datensatz-kontext .felder { margin-bottom: 0; }
.datensatz-arbeit { min-width: 0; }
.aufgaben-bereich { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.aufgaben-bereich .kopfzeile { margin-bottom: 18px; }
.aufgaben-bereich .leer { font-size: 14px; }
.zeitleiste { margin-block: 28px; }
.zeitleiste-eintrag { overflow-wrap: anywhere; padding: 20px; }
.zeitleiste-eintrag .meta { margin-bottom: 14px; font-size: 12px; }
.zeitleiste nav { display: flex; flex-wrap: wrap; gap: 16px; }
.zeitleiste-erfassung { margin-bottom: 20px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.zeitleiste-erfassung summary { padding: 13px 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.zeitleiste-erfassung form { padding: 10px 0 20px; }
.suchbegriff, .hilfe { overflow-wrap: anywhere; }
.hilfe { max-width: 760px; }
.hilfe h2 { margin-top: 32px; }
@media (min-width: 701px) {
  .mit-leiste { grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: none; }
  .leiste { position: sticky; top: 0; height: 100dvh; overflow-y: auto; flex-wrap: nowrap; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 25px 15px 16px; }
  .leiste .marke { padding: 0 12px 16px; }
  .navigation-inhalt { flex: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .leiste ul { display: block; }
  .abschnitt { display: block; }
  .globale-suche { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 0; }
  .globale-suche label { padding-left: 3px; }
  .globale-suche button { min-height: 36px; padding: 5px 12px; font-size: 12px; background: #41473c; color: var(--sidebar-text); }
  .leiste .hilfe-link { margin-top: auto; font-size: inherit; }
  .leiste .abmelden { margin-top: 5px; }
  .inhalt { padding: 38px clamp(24px,3vw,48px) 64px; }
  .arbeitsplatz-kopf { padding-inline: clamp(24px,3vw,48px); }
  .felder { grid-template-columns: minmax(100px,max-content) minmax(0, 1fr); gap: 10px 24px; }
  .felder dd { margin-bottom: 0; }
  .datensatz-kontext .felder { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .datensatz-kontext .felder dd { margin-bottom: 15px; }
  .tabelle .neben { display: table-cell; }
  .kanban { grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: minmax(200px,1fr); overflow-x: auto; }
}
@media (min-width: 1150px) {
  .heute-listen { grid-template-columns: repeat(3,minmax(0, 1fr)); }
  .suchergebnisse { grid-template-columns: repeat(3,minmax(0, 1fr)); }
  .datensatz-layout { grid-template-columns: minmax(230px,300px) minmax(0, 1fr); }
}
/* Dark via data-theme, set by static/kern-theme.js: the stored choice, otherwise the system (owner, 04.11.2026). */
[data-theme=dark] { --bg:#1c1e1b; --surface:#262924; --stone:#33372f; --graphite:#f1f2eb; --text:#e4e7dc; --muted:#b7bdae; --line:#444a3d; --signal-deep:#7cc4bb; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Mail source and untrusted long headers must stay readable on narrow screens. */
.mail-inhalt { overflow-wrap: anywhere; }
/* Überfälliges zuerst erkennbar machen; Kartentitel bleiben ruhig. */
.karte.ueberfaellig { border-left: 4px solid var(--ampel-rot); }
.arbeitslisten .karte > a { color: var(--text); }
.karte.ueberfaellig .leer strong { display: inline-flex; padding: 1px 7px;
  border: 1px solid var(--ampel-rot); border-radius: 5px; color: var(--text); }

/* Long checksums must remain readable on narrow document detail pages. */
.pruefwert { overflow-wrap: anywhere; }

.suchformular { margin-bottom: 28px; }
.suchseiten { align-items: center; }
.suchseiten a, .zeitleiste nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; }
.suchseiten span { font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .kopfzeile > a, .felder dd > a, .heute-liste .karte > a, .suchliste .karte > a, .kanban .karte > a, .inhalt li > a {
    display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere;
  }
}

/* CRM-Listen behalten mobil alle Angaben als beschriftete Datensatzkarten. */
.crm-liste { table-layout: fixed; }
.crm-liste td { overflow-wrap: anywhere; }
.crm-liste tbody tr { cursor: pointer; }
.crm-liste tbody tr:hover, .crm-liste tbody tr:focus-within { background: var(--stone); }
.crm-liste td a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
.crm-liste td:first-child a { color: var(--text); font-weight: 650; }
@media (max-width: 700px) {
  .crm-liste, .crm-liste tbody, .crm-liste tr, .crm-liste td, .crm-liste .neben { display: block; }
  .crm-liste { border: 0; background: transparent; }
  .crm-liste thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .crm-liste tbody tr { margin-bottom: 14px; padding: 8px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .crm-liste td, .crm-liste tr:last-child td { padding: 4px 0; border: 0; }
  .crm-liste td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
  .crm-liste td:first-child a { display: flex; }
}

/* Kompakt (Inhaber 03.11.2026): Laptop-Zeilen um 40 px, die ganze Zeile ist klickbar. */
.titelzelle form { display: inline-block; vertical-align: middle; margin: -6px 4px -6px -8px; }
@media (min-width: 701px) {
  .tabelle th, .tabelle td { padding: 8px 12px; }
  .crm-liste td a { min-height: 28px; }
  .titelzelle .abhaken { width: 32px; height: 32px; min-height: 32px; }
  .crm-liste th:first-child { width: 38%; }
  .crm-liste td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crm-liste td a { display: inline; }
}
.crm-liste a { text-decoration: none; }
.crm-liste a:hover { text-decoration: underline; }
/* Handy: Karten ohne eigene Zeile je Feldname. */
@media (max-width: 700px) {
  .crm-liste tbody tr { margin-bottom: 8px; padding: 6px 12px 8px; }
  .crm-liste td, .crm-liste tr:last-child td { padding: 1px 0; }
  .crm-liste td[data-label]::before { content: attr(data-label) ": "; display: inline; font-size: 13px; }
  .crm-liste td:not(:first-child) a { min-height: 24px; }
  .crm-liste td.titelzelle { display: flex; align-items: center; }
  .titelzelle form { margin: 0 4px 0 -10px; }
}
/* Zeitleiste: „Ergebnis“ gehört nur zum Gespräch. */
.zeitleiste-erfassung form:has(select[name=art] option[value=notiz]:checked) .feld-ergebnis { display: none; }

.phase-aktionen button[disabled] { background: var(--stone); color: var(--muted); cursor: default; }

/* IN-045: "Passwort anzeigen" under each password field (static/kern-passwort.js) */
button.passwort-zeigen { display: block; align-self: flex-start; min-height: 44px; margin: 4px 0 0; padding: 0 2px; background: transparent;
  border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
button.passwort-zeigen:hover { color: var(--text); filter: none; }
button.passwort-zeigen:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
