/* ============ Enrique Zinke CRM — Designsystem ============
   Farben & Stil unveraendert aus dem Vorgaenger-CRM uebernommen:
   Primär #00b4d8 · Hell #f3f3f3 · Dunkel #181b1b · Fraunces (Display) + Manrope (Text)
   Glasmorphismus, weiche Schatten, abgerundete Ecken, vertikale Streifen */

@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  /* Pipedrive-nahe Anmutung für leichten Umstieg — grüne Aktionen, helle flache Flächen.
     Cyan bleibt als Akzent (Links, aktive Navigation, Login). */
  --primary: #00b4d8;
  --primary-deep: #0077b6;
  --primary-navy: #1a2c56;
  --primary-100: #d9f1f8;
  --primary-200: #90e0ef;
  /* Persönliche Farben (pro Nutzer überschrieben via JS) — Defaults hier */
  --mail-sent: #39ff14;
  --mail-recv: #0077b6;
  --cal-ev: #00b4d8;
  --cal-ev-deep: #0077b6;
  --cta: #10863a;      /* 4,67:1 mit weißer Schrift — vorher #12943c mit 3,94:1 */            /* Primäraktionen (Speichern, +Deal) — grün wie gewohnt */
  --cta-deep: #0c7530;
  --bg: #f4f5f7;
  --ink: #26292c;
  --ink-60: #5a6161;
  --ink-40: #6b7272;   /* 4,91:1 auf Weiß — vorher #8b9292 mit 3,17:1 */
  --card: #ffffff;
  --card-solid: #fff;
  --line: rgba(38,41,44,.13);
  --danger: #d94f46;
  --warn: #f0a92e;
  --ok: #12943c;
  --shadow: 0 6px 20px rgba(38,41,44,.09);
  --shadow-sm: 0 2px 8px rgba(38,41,44,.06);

  /* CI-Palette (Design Guidelines) */
  --ci-100: #caf0f8;
  --ci-200: #90e0ef;
  --ci-deep: #0077b6;
  --ci-navy: #03045e;

  /* Liquid Glass: transluzente Flächen, weiche Glanzkanten, Tiefe durch Blur.
     Nur auf STRUKTUR (Sidebar, Kopfleiste, Spalten, Dialoge) — nie hinter Fließtext,
     sonst fällt der Kontrast unter den Standard. */
  --glass: rgba(255,255,255,.60);
  --glass-strong: rgba(255,255,255,.80);
  --glass-brd: rgba(255,255,255,.70);
  --glass-dark: rgba(24,27,27,.74);
  --blur: 16px;
  --sheen: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0) 58%);

  /* LED: das Leuchten macht die Wirkung, nicht die Textfarbe.
     Deshalb liegt Text nie auf hellem Cyan (weiß darauf = 2,46:1). */
  --led: 0 0 6px rgba(0,180,216,.90), 0 0 18px rgba(0,180,216,.42);
  --led-soft: 0 0 4px rgba(0,180,216,.55), 0 0 12px rgba(0,180,216,.20);
  --led-strong: 0 0 8px rgba(0,180,216,1), 0 0 26px rgba(0,180,216,.55);
  --led-fill: linear-gradient(120deg, var(--ci-deep), var(--ci-navy));
  /* Helle Phasen: die Schrift bleibt dunkel, die Markierung nur ein Hauch.
     Enrique 10.07.2026: „leichter markiert, das ist zu stark" — deshalb sehr helle
     Verläufe und kaum Leuchten. Navy auf #caf0f8 = 11,92:1, auf #90e0ef = 7,20:1. */
  --led-fill-soft: linear-gradient(120deg, #f4fcfe, var(--ci-100));
  --led-fill-cur: linear-gradient(120deg, var(--ci-100), var(--ci-200));
  --led-ink: var(--ci-navy);

  /* Ecken immer leicht abgerundet — niemals harte Kanten */
  --r-lg: 16px; --r-md: 12px; --r-sm: 9px; --r-pill: 999px;
  --sidebar-w: 200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* Wiederkehrende CI-Elemente: vertikale Streifen + weicher Cyan-Verlauf */
  background:
    radial-gradient(1100px 480px at 12% -12%, rgba(0,180,216,.11), transparent 62%),
    radial-gradient(900px 460px at 102% -4%, rgba(144,224,239,.16), transparent 58%),
    repeating-linear-gradient(90deg, rgba(38,41,44,.026) 0 1px, transparent 1px 44px),
    var(--bg);
  background-attachment: fixed;
}
h1,h2,h3 { font-weight: 700; letter-spacing: -.01em; }
.login-card h1 { font-family: 'Fraunces', serif; font-weight: 600; }
a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
/* Inline-SVG-Icons: nie unskaliert rendern (Standardgröße, spezifische Regeln überschreiben) */
svg { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }

.boot-splash { height: 100vh; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--ink-60); }

/* ============ Shell ============ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; overflow: hidden; position: relative; z-index: 1; }
.sidebar {
  background: linear-gradient(180deg, rgba(24,27,27,.90), rgba(24,27,27,.78));
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  border-right: 1px solid rgba(144,224,239,.14);
  color: #eaf6fa; display: flex; flex-direction: column; padding: 14px 10px; gap: 4px;
  height: 100vh; min-height: 0; overflow-y: auto; position: relative;
}
/* LED-Kante an der Innenseite */
.sidebar::after {
  content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0,180,216,.55) 18%, rgba(0,180,216,.55) 82%, transparent);
  box-shadow: var(--led-soft); pointer-events: none;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 16px; }
.sidebar .brand img { width: 30px; height: 30px; }
.sidebar .brand b { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.sidebar .brand small { display:block; color: var(--primary-200); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: #cfe6ee; cursor: pointer; user-select: none; border: 1px solid transparent;
  font-weight: 500; position: relative; transition: background .12s;
}
.nav-item:hover { background: rgba(144,224,239,.09); text-decoration: none; color: #fff; }
.nav-item.active {
  background: linear-gradient(120deg, rgba(0,180,216,.26), rgba(0,180,216,.08));
  border-color: rgba(0,180,216,.40); color: #fff;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: var(--r-pill); background: var(--primary); box-shadow: var(--led);
}
.nav-item .count { box-shadow: var(--led-soft); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .count { margin-left: auto; background: var(--primary); color: #04263a; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: var(--r-pill); }
.nav-sep { flex: 1; }
.nav-user { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.09); cursor: pointer; border-radius: var(--r-sm); }
.nav-user:hover { background: rgba(144,224,239,.09); }
.nav-user small { color: #9fb6c1; display: block; font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; }
.content { min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-bottom: 1px solid var(--glass-brd);
  position: sticky; top: 0; z-index: 30;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,180,216,.55), transparent);
  box-shadow: var(--led-soft); pointer-events: none;
}
.topbar h1 { font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: -.005em; }
.topbar h1 { font-size: 21px; margin: 0; }
.topbar .search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.topbar .search input {
  width: 100%; padding: 9px 14px 9px 38px; border-radius: var(--r-pill); border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,.72); backdrop-filter: blur(8px); outline: none;
  transition: box-shadow .18s, border-color .18s, background .18s;
}
.topbar .search input:focus {
  background: #fff; border-color: rgba(0,180,216,.6);
  box-shadow: 0 0 0 3px var(--primary-100), var(--led-soft);
}
/* NUR das Lupen-Icon absolut setzen — '.search svg' traf auch die Icons in den
   Dropdown-Treffern und stapelte sie über der „Zuletzt angesehen"-Zeile. */
.topbar .search > svg { position: absolute; left: 13px; top: 9px; width: 17px; height: 17px; color: var(--ink-40); }
.searchdd svg { width: 15px; height: 15px; flex: none; }
/* Arbeitszeit-Tracker in der Sidebar + Pflicht-Overlay */
.work-box { margin: 4px 10px 8px; padding: 9px 10px; border-radius: var(--r-md); background: rgba(255,255,255,.07); color: #dfe5e5; }
.wt-actions { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.wt-actions .btn { width: 100%; }
/* Buttons füllen die Box und ragen nicht mehr über die Sidebar hinaus (Enrique, Bild 10.07.) */
.work-box .btn { padding: 5px 8px; font-size: 11px; white-space: nowrap; text-align: center; justify-content: center; }
.work-box .btn.wt-pause, .work-box .btn.wt-stop { box-shadow: 0 0 4px rgba(0,180,216,.6), 0 0 9px rgba(0,180,216,.25); }
.work-box .btn.wt-stop { box-shadow: 0 0 4px rgba(46,204,113,.6), 0 0 9px rgba(46,204,113,.25); }
.work-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #8b9292; }
.work-dot.arbeit { background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,.9); }
.work-dot.pause { background: #f5b942; box-shadow: 0 0 6px rgba(245,185,66,.8); }
/* Inaktivitäts-Alarm für Michael: kleine Popups in leichtem Rot, oben rechts gestapelt */
#wae-stapel { position: fixed; top: 62px; right: 16px; z-index: 350; display: flex; flex-direction: column; gap: 8px; }
.wae-alarm {
  display: flex; align-items: flex-start; gap: 9px; max-width: 320px;
  background: #fdecea; color: #8c2f28; border: 1px solid rgba(192,57,43,.35);
  border-left: 4px solid #d9534f; border-radius: var(--r-md); padding: 10px 12px;
  box-shadow: var(--shadow), 0 0 10px rgba(217,83,79,.25); font-size: 13px;
}
.wae-alarm .wae-x { border: none; background: none; color: #8c2f28; font-size: 17px; line-height: 1; cursor: pointer; margin-left: auto; padding: 0 2px; }

/* Incentive-Banner: schmale Zeile zwischen Kopfleiste und Inhalt (nur Vertriebler) */
#inc-banner {
  display: flex; align-items: center; gap: 8px;
  margin: 0 22px; padding: 7px 14px; font-size: 12.5px;
  background: linear-gradient(120deg, var(--ci-100), rgba(255,255,255,.75));
  border: 1px solid rgba(0,180,216,.4); border-radius: var(--r-md);
  box-shadow: var(--led-soft);
}
#inc-banner .inc-text { color: var(--ink-60); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stempel-Buttons in LED-Optik (Enrique): Pause = Blau, Feierabend = Grün */
.btn.wt-pause {
  background: linear-gradient(120deg, #0077b6, #00b4d8); color: #fff; border-color: transparent;
  box-shadow: 0 0 6px rgba(0,180,216,.85), 0 0 16px rgba(0,180,216,.40);
}
.btn.wt-pause:hover { box-shadow: 0 0 8px rgba(0,180,216,1), 0 0 22px rgba(0,180,216,.55); }
.btn.wt-stop {
  background: linear-gradient(120deg, #10863a, #2ecc71); color: #fff; border-color: transparent;
  box-shadow: 0 0 6px rgba(46,204,113,.85), 0 0 16px rgba(46,204,113,.40);
}
.btn.wt-stop:hover { box-shadow: 0 0 8px rgba(46,204,113,1), 0 0 22px rgba(46,204,113,.55); }
#work-gate { position: fixed; inset: 0; z-index: 400; background: rgba(3,4,94,.55); backdrop-filter: blur(7px); display: flex; align-items: center; justify-content: center; }
.work-gate-card { background: #fff; border-radius: var(--r-lg); padding: 34px 46px; text-align: center; box-shadow: var(--shadow), var(--led-soft); max-width: 420px; }

/* Erkannte Telefonnummern: klickbar für Click-to-Call */
.telify { color: var(--primary-navy); cursor: pointer; border-bottom: 1px dashed rgba(0,180,216,.55); white-space: nowrap; }
.telify:hover { color: var(--primary); border-bottom-style: solid; }
.telify::after { content: ' ✆'; font-size: .9em; color: var(--primary); }
.content { flex: 1; overflow: auto; padding: 18px 22px; position: relative; }

/* ============ Bausteine ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card-solid); cursor: pointer; font-weight: 600;
  box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .12s, background .12s; white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--cta); color: #fff; border: none; }
.btn.primary:hover { background: var(--cta-deep); }
/* Cyan-Aktionen (Navigation, Links) leuchten, grüne Bestätigungen bleiben ruhig */
.btn.led { background: var(--led-fill); color: #fff; border: 1px solid rgba(0,180,216,.5); box-shadow: var(--led-soft); }
.btn.led:hover { box-shadow: var(--led); }
.btn.danger { background: var(--danger); color: #fff; border: none; }
.btn.ok { background: var(--ok); color: #fff; border: none; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,180,216,.08); transform: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px;
  position: relative;
}
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-100); color: var(--primary-navy); padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; }
.chip.warn { background: #fdeece; color: #7a5410; }
.chip.danger { background: #fadcda; color: #7a201a; }
.chip.ok { background: #d8f2e4; color: #175c38; }
.chip.gray { background: #e8eaea; color: var(--ink-60); }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; flex: none; }

input.field, select.field, textarea.field {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; outline: none; transition: box-shadow .15s;
}
.field:focus { box-shadow: 0 0 0 3px var(--primary-100); border-color: var(--primary); }
label.lbl { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-60); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 4px; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--card-solid); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-60); padding: 10px 12px; border-bottom: 2px solid var(--line); background: #fafbfb; position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(0,180,216,.045); }
.tbl tr { cursor: pointer; }

/* ============ Kanban ============ */
.pipeline-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(238px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 90px; min-height: 65vh; }
.kcol {
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: var(--r-lg);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; max-height: calc(100vh - 220px);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.kcol header {
  padding: 12px 14px 10px; background: transparent; position: relative;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
/* LED-Leuchtlinie unter dem Spaltenkopf */
.kcol header::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), rgba(0,180,216,.15));
  box-shadow: var(--led-soft);
}
.kcol header .t { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kcol header .t .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Anzahl der Leads — die Hauptaussage des Spaltenkopfs */
.kcol header .cnt {
  flex: none; min-width: 28px; text-align: center; padding: 2px 9px;
  border-radius: var(--r-pill); font-size: 11.5px; font-weight: 800;
  color: #0a3d52; background: linear-gradient(180deg, #eafaff, var(--ci-100));
  border: 1px solid rgba(0,180,216,.38); box-shadow: var(--led-soft);
}
.kcol .cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
/* Karten bleiben UNDURCHSICHTIG: sie tragen den Text und müssen scharf lesbar bleiben.
   Blur auf hunderten Karten wäre außerdem beim Scrollen spürbar träge. */
.kcard {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 12px 11px 14px; cursor: grab; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .14s ease, border-color .18s ease;
  position: relative; overflow: hidden;
  /* overflow:hidden setzt die Flex-Mindesthöhe auf 0 — ohne flex-shrink:0 würden
     volle Spalten die Karten zu schmalen Streifen quetschen statt zu scrollen. */
  flex-shrink: 0;
}
/* LED-Kante links, leuchtet beim Überfahren auf */
.kcard::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: var(--r-pill); background: var(--ci-200); opacity: .45;
  transition: opacity .18s ease, box-shadow .18s ease;
}
.kcard:hover {
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,180,216,.28);
  transform: translateY(-2px); border-color: rgba(0,180,216,.30);
}
.kcard:hover::before { opacity: 1; background: var(--primary); box-shadow: var(--led); }
.kcard.dragging { opacity: .45; transform: rotate(2deg); }
.kcard .t { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.kcard .s { color: var(--ink-60); font-size: 12px; }
.kcard .foot { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.kcard .foot .v { font-weight: 700; font-size: 12px; color: var(--primary-navy); }
.kcard .warn-dot { position: absolute; right: 9px; top: 9px; color: var(--warn); }
.kcol.drag-over {
  outline: none; border-color: var(--primary);
  box-shadow: var(--led), inset 0 0 30px rgba(0,180,216,.10);
}
.kcard.dragging { opacity: .5; transform: rotate(1.5deg) scale(.98); box-shadow: var(--led); }
.dropzones { position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; display: none; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 12px 22px; z-index: 50; }
.dropzones.show { display: grid; }
.dz { border-radius: var(--r-md); padding: 20px; text-align: center; font-weight: 800; color: #fff; opacity: .93; border: 2px dashed rgba(255,255,255,.6); }
.dz.won { background: var(--ok); } .dz.lost { background: var(--danger); } .dz.del { background: #444; }
.dz.drag-over { transform: scale(1.03); opacity: 1; }

/* ============ Deal-Detail ============ */
.detail-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
/* Phasenleiste: runde LED-Segmente statt harter Chevrons.
   Erledigte Phasen leuchten, die aktuelle Phase pulst.
   Weiße Schrift liegt auf tiefem Blau (4,87:1) — nie auf hellem Cyan (dort nur 2,46:1). */
.stagebar { display: flex; gap: 6px; margin: 6px 0 18px; }
.stagebar .seg {
  flex: 1; height: 32px; position: relative; cursor: pointer; overflow: hidden;
  border-radius: var(--r-pill); border: 1px solid var(--glass-brd);
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-60); font-weight: 700; letter-spacing: .01em;
  transition: transform .16s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
}
/* Glanzkante oben — der „Liquid Glass"-Effekt */
.stagebar .seg::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 52%;
  background: var(--sheen); pointer-events: none; border-radius: var(--r-pill) var(--r-pill) 0 0;
}
.stagebar .seg.done {
  background: var(--led-fill-soft); color: var(--led-ink);
  border-color: rgba(0,180,216,.28); box-shadow: none;
}
/* Aktuelle Phase: erkennbar, aber ruhig — kein Pulsieren, nur ein weiches Leuchten */
.stagebar .seg.cur {
  background: var(--led-fill-cur); color: var(--led-ink);
  border-color: rgba(0,180,216,.55);
  box-shadow: var(--led-soft);
}
.stagebar .seg:hover { transform: translateY(-1px); box-shadow: var(--led-soft); }
.stagebar .seg:not(.done):hover { color: var(--ink); border-color: rgba(0,180,216,.45); }

@keyframes ledPuls {
  0%, 100% { box-shadow: var(--led), inset 0 0 0 1px rgba(255,255,255,.45); }
  50%      { box-shadow: var(--led-strong), inset 0 0 0 1px rgba(255,255,255,.75); }
}
.side-sec { border-top: 1px solid var(--line); padding: 12px 0; }
.side-sec h3 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 6px 10px; font-size: 13px; align-items: start; }
.kv .k { color: var(--ink-40); font-size: 11.5px; padding-top: 3px; line-height: 1.35; word-break: break-word; }
.kv .v { min-height: 20px; border-radius: var(--r-sm); padding: 2px 5px; line-height: 1.4; overflow-wrap: anywhere; }
.kv .v .btn.ghost.sm { vertical-align: middle; }
.kv .v.editable:hover { background: var(--primary-100); cursor: pointer; }
.composer-collapsed { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink-40); cursor: text; }
.compose-inline { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: #fff; }
.compose-inline .rich { min-height: 150px; }
.composer-collapsed:hover { border-color: var(--primary); color: var(--ink-60); }
.composer-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.composer-tabs .ct { padding: 9px 14px; cursor: pointer; font-weight: 700; color: var(--ink-60); border-bottom: 2px solid transparent; margin-bottom: -2px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.composer-tabs .ct.active { color: var(--primary-deep); border-bottom-color: var(--primary); }
.timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tl-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.tl-item .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-100); color: var(--primary-deep); display: flex; align-items: center; justify-content: center; margin-top: 3px; }
.tl-item .body { background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 13px; box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.tl-item .body.note { background: #fdf9e7; border-color: #f1e6b8; }
.tl-item .meta { font-size: 11.5px; color: var(--ink-40); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-item .meta .sp { flex: 1; }
.tl-filter { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 2px; }
.tl-filter .tf { padding: 4px 11px; border-radius: var(--r-pill); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-60); }
.tl-filter .tf.active { background: var(--primary-navy); color: #fff; }

/* ============ Mail ============ */
.mail-grid { display: grid; grid-template-columns: 190px 380px 1fr; gap: 14px; height: calc(100vh - 130px); }
.mail-folders { display: flex; flex-direction: column; gap: 3px; }
.mail-folder { padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; }
.mail-folder:hover { background: rgba(0,180,216,.08); }
.mail-folder.active { background: var(--primary-navy); color: #fff; }
.mail-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.mail-row { background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; cursor: pointer; }
.mail-row:hover { box-shadow: var(--shadow-sm); }
.mail-row.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.mail-row .from { font-weight: 700; font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; }
.mail-row .subj { font-size: 12.5px; margin: 1px 0; }
.mail-row.unread .subj, .mail-row.unread .from { font-weight: 800; }
/* Ungelesene Mails DEUTLICH markieren (Enrique, 15.07.2026) — Farbe pro Nutzer einstellbar
   (Mein Profil → Farben → „Ungelesene Mails"), Standard kräftiges Orange */
.mail-row.unread { border-left: 5px solid var(--mail-unread, #ff9500); background: color-mix(in srgb, var(--mail-unread, #ff9500) 10%, #fff); }
.mail-row.unread .from > span:first-child::before { content: '●'; color: var(--mail-unread, #ff9500); margin-right: 6px; font-size: 11px; }
.mail-row .snip { color: var(--ink-40); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Abhak-Kreis wie Pipedrive (Enrique, 15.07.2026): leerer Kreis = offen, Klick hakt ab.
   Grün gefüllt = wirklich erledigt. */
.hak-kreis { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9aa5ab; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; line-height: 1; color: transparent; background: #fff; transition: all .15s; flex: none; box-sizing: border-box; }
button:hover .hak-kreis:not(.done), .hak-kreis:not(.done):hover { border-color: #12943c; color: #12943c; background: #eafaf0; }
.hak-kreis.done { background: #12943c; border-color: #12943c; color: #fff; }
.mail-view { overflow-y: auto; }
.mail-msg { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; margin-bottom: 10px; }
.mail-msg .head { padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mail-msg .bodyc { padding: 13px; overflow-x: auto; font-size: 13.5px; }
.mail-msg .bodyc img { max-width: 100%; }

/* ============ Kalender ============ */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: 46px repeat(7, 1fr); background: var(--card-solid); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-grid .h { padding: 8px 4px; text-align: center; font-weight: 800; font-size: 12px; border-bottom: 2px solid var(--line); background: #fafbfb; }
.cal-grid .h.today { color: var(--primary-deep); }
.cal-hour { font-size: 10px; color: var(--ink-40); text-align: right; padding: 0 5px; border-right: 1px solid var(--line); height: 44px; }
.cal-cell { border-left: 1px solid var(--line); border-top: 1px solid rgba(24,27,27,.05); position: relative; height: 44px; cursor: pointer; }
.cal-cell:hover { background: rgba(0,180,216,.05); }
.cal-ev { position: absolute; left: 2px; right: 3px; background: linear-gradient(120deg, var(--cal-ev), var(--cal-ev-deep)); color: #fff; border-radius: 7px; font-size: 10.5px; padding: 2px 6px; overflow: hidden; cursor: pointer; z-index: 2; box-shadow: var(--shadow-sm); }
.cal-ev.done { background: #cfe7db; color: #175c38; text-decoration: line-through; }
.cal-ev.overdue { background: linear-gradient(120deg, #e2695f, #d94f46); }
.cal-ev.external { background: repeating-linear-gradient(45deg, #b8c4cc 0 6px, #a9b7c0 6px 12px); color: #26323a; }
.cal-ev[draggable="true"] { cursor: grab; }
.cal-ev.dragging { opacity: .45; cursor: grabbing; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.cal-cell.drop-hot { background: rgba(0,180,216,.18); box-shadow: inset 0 0 0 2px rgba(0,180,216,.55); }
.v .weblink, a.weblink { color: var(--brand, #0077b6); text-decoration: none; border-bottom: 1px solid rgba(0,119,182,.35); word-break: break-all; }
.v .weblink:hover, a.weblink:hover { text-decoration: none; border-bottom-color: var(--brand, #0077b6); }
.v.editable.has-link { cursor: default; }
/* „Jetzt"-Linie (aktuelle Uhrzeit, läuft live) — Markenblau im LED-Look */
.cal-now { position: absolute; left: 46px; right: 0; height: 0; border-top: 1px solid var(--primary); box-shadow: 0 0 4px var(--primary), 0 0 8px rgba(0,180,216,.5); z-index: 4; pointer-events: none; }
.cal-now-dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 5px var(--primary), 0 0 9px rgba(0,180,216,.7); }
.dc-now { position: absolute; left: 46px; right: 6px; height: 0; border-top: 1px solid var(--primary); box-shadow: 0 0 4px var(--primary), 0 0 8px rgba(0,180,216,.5); z-index: 3; pointer-events: none; }
.dc-now-dot { position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 4px var(--primary), 0 0 8px rgba(0,180,216,.7); }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-mday { background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-md); min-height: 108px; padding: 6px 8px; cursor: pointer; }
.cal-mday .d { font-weight: 800; font-size: 12px; color: var(--ink-60); }
.cal-mday.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.cal-mday .ev { font-size: 10.5px; background: var(--primary-100); color: var(--primary-navy); padding: 1px 6px; border-radius: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-mday .ev.done { background: #d8f2e4; color: #175c38; text-decoration: line-through; }

/* ============ Modal / Dropdown / Toast ============ */
.modal-back {
  position: fixed; inset: 0; background: rgba(3,4,94,.32);
  backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--r-lg); position: relative; overflow: hidden;
  border: 1px solid var(--glass-brd);
  box-shadow: 0 30px 90px rgba(3,4,94,.38), 0 0 0 1px rgba(0,180,216,.10);
  width: 560px; max-width: 100%; animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
/* LED-Kante am oberen Rand des Dialogs */
.modal::before {
  content: ''; position: absolute; left: 18%; right: 18%; top: 0; height: 2px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: var(--led-soft);
}
.modal.lg { width: 780px; }
.modal .mhead { padding: 16px 20px 0; display: flex; justify-content: space-between; align-items: center; }
.modal .mhead h2 { margin: 0; font-size: 19px; }
.modal .mbody { padding: 10px 20px 20px; }
.modal .mfoot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.x { cursor: pointer; border: none; background: none; font-size: 21px; color: var(--ink-40); line-height: 1; }
.x:hover { color: var(--ink); }

.dd { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); z-index: 120; min-width: 180px; max-height: 320px; overflow-y: auto; padding: 5px; }
.dd .di { padding: 7px 11px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.dd .di:hover, .dd .di.hover { background: var(--primary-100); }
.dd .di small { color: var(--ink-40); margin-left: auto; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast { background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 11px 16px; box-shadow: var(--shadow); animation: pop .2s; max-width: 380px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ============ Login ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background: radial-gradient(1100px 600px at 78% -10%, rgba(0,180,216,.28), transparent 60%),
              radial-gradient(900px 550px at -10% 110%, rgba(3,4,94,.20), transparent 55%), var(--bg);
}
.login-wrap::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(3,4,94,.03) 0 1px, transparent 1px 72px); }
.login-wrap::after { content: ''; position: absolute; width: 420px; height: 420px; right: -80px; bottom: -80px; border-radius: 50%;
  background: radial-gradient(circle at 6px 6px, rgba(0,180,216,.30) 2.2px, transparent 2.6px); background-size: 21px 21px; opacity:.55; }
.login-card {
  position: relative; z-index: 2; width: 400px; max-width: 92vw; padding: 34px 32px 28px;
  background: rgba(255,255,255,.66); backdrop-filter: blur(22px); border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px; box-shadow: 0 28px 90px rgba(3,4,94,.22);
}
.login-card h1 { margin: 14px 0 2px; font-size: 26px; }
.login-card p.sub { color: var(--ink-60); margin: 0 0 18px; }

.empty { text-align: center; color: var(--ink-40); padding: 44px 10px; }
.spin { width: 22px; height: 22px; border: 3px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: rot .8s linear infinite; margin: 30px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.flex { display: flex; gap: 10px; align-items: center; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--ink-40); } .small { font-size: 12px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.pill-tabs { display: inline-flex; background: rgba(3,4,94,.06); border-radius: 12px; padding: 3px; gap: 2px; }
.pill-tabs .pt { padding: 6px 13px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--ink-60); }
.pill-tabs .pt.active { background: #fff; color: var(--primary-navy); box-shadow: var(--shadow-sm); }
.searchdd { position: absolute; top: 44px; left: 0; right: 0; }
.rich { min-height: 130px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: #fff; outline: none; overflow-y: auto; max-height: 320px; }
.rich:focus { box-shadow: 0 0 0 3px var(--primary-100); border-color: var(--primary); }
.settings-grid { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 3px; }
.set-nav .si { padding: 9px 13px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; }
.set-nav .si:hover { background: rgba(0,180,216,.08); }
.set-nav .si.active { background: var(--primary-navy); color: #fff; }
@media (max-width: 1000px) {
  .detail-grid, .mail-grid, .settings-grid { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 64px 1fr; }
  .sidebar .brand b, .sidebar .brand small, .nav-item span, .nav-user div { display: none; }
}


/* Mail-Inhalte laufen in einem abgeschotteten iframe (kein Skript, kein Plugin) */
.mail-frame { width:100%; border:0; display:block; height:120px; background:#fff; }


/* ===== Fokus-Sichtbarkeit =====
   Tastaturnutzer müssen sehen, wo sie stehen. :focus-visible greift nur bei Tastatur,
   nicht bei Mausklick — der Ring stört die Mausbedienung also nicht. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.btn:focus-visible, .field:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-100);
}
.btn.danger:focus-visible { outline-color: var(--danger); box-shadow: 0 0 0 4px rgba(217,79,70,.18); }

/* Link-artiger Button: sieht aus wie ein Link, ist aber tastaturbedienbar und
   braucht kein Inline-onclick (das die Content-Security-Policy verbietet). */
.linkbtn { background:none; border:0; padding:0; margin:0; font:inherit; color:var(--primary-deep);
  cursor:pointer; text-decoration:none; }
.linkbtn:hover { text-decoration:underline; }
.linkbtn.danger { color:var(--danger); }


/* Wer im Betriebssystem weniger Bewegung eingestellt hat, bekommt keine Animation. */
@media (prefers-reduced-motion: reduce) {
  .stagebar .seg.cur { animation: none; }
  .kcard, .kcol, .stagebar .seg, .btn { transition: none; }
}
