/* ============================================================
   WerkOS — Handwerker-App Prototyp
   Palette: Kittel-Weiß / Tinte / Arbeitsblau / Abklebeband-Gelb
   Signatur: Status-Farbkarten (Malerfächer)
   ============================================================ */

:root {
  --bg:        #F7F6F3;
  --bg-deep:   #EFEDE8;
  --card:      #FFFFFF;
  --ink:       #1C2530;
  --ink-soft:  #5A6472;
  --ink-faint: #8C93A3;
  --line:      #E3E1DA;
  --brand:     #24486E;
  --brand-deep:#1A3552;
  --brand-soft:#E8EEF5;
  --tape:      #F0B429;
  --danger:    #C0392B;

  --st-offen:        #8C93A3;
  --st-geplant:      #5B8DEF;
  --st-in_arbeit:    #F0A030;
  --st-angebot_raus: #9B72CF;
  --st-restarbeit:   #E2574C;
  --st-fertig:       #3E9B6C;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(28,37,48,.06), 0 4px 16px rgba(28,37,48,.07);
  --shadow-lift: 0 4px 8px rgba(28,37,48,.1), 0 12px 32px rgba(28,37,48,.14);
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-display: 'Archivo', 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  font-feature-settings: 'tnum' 1;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- App-Rahmen: Sidebar (Desktop) / Bottom-Tabs (Mobil) ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--brand-deep);
  color: #E9EEF4;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 21px; letter-spacing: .3px;
  color: #fff; padding: 4px 10px 2px;
  display: flex; align-items: center;
}
.sidebar .logo .dot { color: var(--tape); }
.logo .mark { width: 24px; height: 24px; flex: 0 0 24px; margin-right: 9px; }
.sidebar .tenant {
  font-size: 12px; color: #9FB2C6; padding: 0 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; color: #C6D2DE;
  font-size: 14.5px; font-weight: 500;
  padding: 10px 12px; border-radius: 8px; text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.nav-btn svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-btn { position: relative; }
.nav-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-btn.active { background: var(--brand); color: #fff; }
/* Abklebeband-Kante am aktiven Punkt — das Gelb zieht sich durch die App */
.nav-btn.active::before {
  content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px;
  width: 4px; border-radius: 0 3px 3px 0; background: var(--tape);
}
.sidebar .spacer { flex: 1; }
.sidebar .whoami { font-size: 12.5px; color: #9FB2C6; padding: 8px 12px; line-height: 1.5; }
.sidebar .whoami b { color: #E9EEF4; display: block; }

.main { min-width: 0; padding: 26px 30px 90px; }

/* Mobile Tab-Bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px 14px 84px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--brand-deep);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    flex: 1; background: none; border: 0; color: #C6D2DE;
    font-size: 10.5px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
    border-radius: 8px;
  }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.active { color: var(--tape); }
}

/* ---------- Kopfzeile je View ---------- */
.view-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.view-head h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .2px;
}
.view-head .sub { color: var(--ink-soft); font-size: 13.5px; width: 100%; margin-top: -6px; }
.view-head .grow { flex: 1; }

/* ---------- Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; border: 0;
  font-size: 14.5px; font-weight: 600;
  padding: 10px 16px; border-radius: 8px;
  transition: background .12s, transform .06s;
}
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.quiet { background: var(--bg-deep); color: var(--ink); }
.btn.quiet:hover { background: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.small { padding: 6px 11px; font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; min-width: 220px;
}
.searchbar input { border: 0; outline: none; background: none; width: 100%; }
.searchbar svg { width: 16px; height: 16px; color: var(--ink-faint); flex: 0 0 16px; }

input.field, select.field, textarea.field {
  width: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; transition: border-color .12s;
}
input.field:focus, select.field:focus, textarea.field:focus { border-color: var(--brand); outline: none; }
textarea.field { resize: vertical; min-height: 70px; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; }

/* ---------- Status-Farbkarte (Signatur-Element) ---------- */
.swatch {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px 4px 6px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-soft); white-space: nowrap;
}
.swatch::before {
  content: ''; width: 14px; height: 18px; border-radius: 3px;
  background: var(--sw, var(--ink-faint));
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.14);
}
.swatch.clickable { cursor: pointer; }
.swatch.clickable:hover { border-color: var(--sw); }
/* Auf Board-Karten: nur die Farbkarte, kein Text (Spalte sagt den Status schon) */
.swatch.nur-karte { padding: 4px 6px; gap: 0; }

/* Farbwahl-Menü (Statuswechsel im Farbfächer-Look) */
.fan-menu {
  position: absolute; z-index: 60; margin-top: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lift); padding: 8px; display: grid; gap: 4px; min-width: 190px;
}
.fan-menu button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; border-radius: 7px;
  padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  text-align: left;
}
.fan-menu button:hover { background: var(--bg-deep); }
.fan-menu .chip {
  width: 22px; height: 28px; border-radius: 4px; flex: 0 0 22px;
  background: var(--sw); box-shadow: inset 0 -6px 0 rgba(0,0,0,.14);
}

/* ---------- Board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 262px; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.board-col { background: var(--bg-deep); border-radius: 12px; padding: 10px; min-height: 120px; }
.board-col-head {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
  padding: 4px 6px 10px; color: var(--ink);
}
.board-col-head .chip { width: 16px; height: 22px; border-radius: 3px; background: var(--sw); box-shadow: inset 0 -5px 0 rgba(0,0,0,.14); }
.board-col-head .count { margin-left: auto; color: var(--ink-faint); font-family: var(--font-ui); font-weight: 600; font-size: 12px; }
.board-cards { display: grid; gap: 8px; }

.proj-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  border-left: 6px solid var(--sw, var(--ink-faint));
  padding: 11px 12px; cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.proj-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.proj-card .t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.proj-card .c { color: var(--ink-soft); font-size: 12.5px; margin-top: 3px; }
.proj-card .meta { display: flex; gap: 10px; align-items: center; color: var(--ink-faint); font-size: 11.5px; margin-top: 8px; }
.proj-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.proj-card .meta svg { width: 13px; height: 13px; }

/* ---------- Tabellen (Kunden, Angebote, Katalog) ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.list th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-faint); font-weight: 700; text-align: left;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--card);
}
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; transition: background .1s; }
table.list tbody tr:hover { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Projektmappe ---------- */
.mappe-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.mappe-head .back { color: var(--ink-faint); background: none; border: 0; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; }
.mappe-head .back:hover { color: var(--brand); }
.mappe-title { font-family: var(--font-display); font-weight: 700; font-size: 23px; }
.mappe-sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 18px 0 18px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 10px 16px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--tape); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.info-tile { padding: 14px 16px; }
.info-tile .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-faint); font-weight: 700; margin-bottom: 5px; }
.info-tile .v { font-size: 14.5px; line-height: 1.5; }

/* ---------- Chat ---------- */
.chat-box { display: flex; flex-direction: column; height: min(58vh, 560px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; }
.msg .bubble {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px; padding: 9px 13px; font-size: 14px; line-height: 1.45;
  box-shadow: var(--shadow);
}
.msg.mine .bubble { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 12px 12px 4px 12px; }
.msg .who { font-size: 11px; color: var(--ink-faint); margin: 3px 6px 0; }
.msg.mine .who { text-align: right; }
.msg img { max-width: 100%; border-radius: 9px; display: block; margin-top: 6px; cursor: pointer; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); border-radius: 0 0 var(--radius) var(--radius); }
.chat-input input[type=text] { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.chat-input .icon-btn { background: var(--bg-deep); border: 0; border-radius: 8px; width: 42px; display: grid; place-items: center; color: var(--ink-soft); }
.chat-input .icon-btn:hover { background: var(--line); }
.chat-input .icon-btn svg { width: 19px; height: 19px; }

/* ---------- Angebots-Editor ---------- */
.offer-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .offer-grid { grid-template-columns: 1fr; } }

.pos-table { width: 100%; border-collapse: collapse; }
.pos-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.pos-table td { padding: 6px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pos-table input, .pos-table textarea {
  width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 7px 8px;
  background: transparent; font-size: 13.5px;
}
.pos-table textarea { resize: none; min-height: 34px; line-height: 1.35; }
.pos-table input:hover, .pos-table textarea:hover { background: var(--bg-deep); }
.pos-table input:focus, .pos-table textarea:focus { background: #fff; border-color: var(--brand); outline: none; }
.pos-table .num input { text-align: right; font-variant-numeric: tabular-nums; }
.pos-table td.sum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; padding-top: 13px; }
.pos-table .rowdel { background: none; border: 0; color: var(--ink-faint); padding: 8px 2px; }
.pos-table .rowdel:hover { color: var(--danger); }
.pos-table .rowtools { white-space: nowrap; text-align: right; }
.pos-table .rowmove { background: none; border: 0; color: var(--ink-faint); padding: 8px 1px; cursor: pointer; font-size: 13px; }
.pos-table .rowmove:hover { color: var(--brand); }
.pos-table .rowmove:disabled { opacity: .25; cursor: default; }
.pos-table tr.titelrow td input { font-weight: 700; font-size: 14px; }

.calc-panel { position: sticky; top: 20px; padding: 16px 18px; }
.calc-panel h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 10px; }
.calc-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; color: var(--ink-soft); }
.calc-row.total { font-size: 16px; font-weight: 700; color: var(--ink); border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 9px; }
.calc-row .v { font-variant-numeric: tabular-nums; }
.calc-db {
  margin-top: 14px; background: var(--brand-soft); border-radius: 8px; padding: 11px 13px;
  border-left: 4px solid var(--tape);
}
.calc-db .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.calc-db .calc-row { color: var(--ink); padding: 3px 0; }
.db-pos { color: var(--st-fertig); } .db-neg { color: var(--danger); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(28,37,48,.45);
  display: grid; place-items: center; padding: 18px;
  animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lift);
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  padding: 22px 24px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal h2 { font-family: var(--font-display); font-size: 19px; margin-bottom: 4px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal.wide { max-width: 760px; }

.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .form-2col { grid-template-columns: 1fr; } }

/* ---------- Leerzustände + Toast + Badges ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-faint); }
.empty::before {
  content: ''; display: block; width: 44px; height: 8px; margin: 0 auto 16px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--st-geplant) 0 33%, var(--tape) 33% 66%, var(--st-fertig) 66%);
  opacity: .45;
}
.empty p { max-width: 400px; margin: 0 auto 16px; line-height: 1.55; }

#toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 99px; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 3px 9px; border-radius: 99px; }
.badge.entwurf    { background: var(--bg-deep); color: var(--ink-soft); }
.badge.versendet  { background: #EAF0FD; color: #3565C4; }
.badge.angenommen { background: #E4F3EB; color: #2E7C53; }
.badge.abgelehnt  { background: #FBE9E7; color: var(--danger); }

.demo-banner {
  position: sticky; top: 0; z-index: 50;
  background: var(--tape); color: #4A3608;
  font-size: 12.5px; font-weight: 700; text-align: center;
  padding: 7px 12px; letter-spacing: .2px;
}
.demo-banner button { background: none; border: 0; text-decoration: underline; font-weight: 700; color: inherit; font-size: inherit; }

/* ---------- Login (Marken-Auftritt statt graue Fläche) ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(155deg, var(--brand-deep) 0%, #14293F 55%, #0F2032 100%); }
.login-wrap::after {
  content: 'Projekte · Angebote · Baustellen-Chat — ein Werkzeug für den ganzen Betrieb';
  position: fixed; bottom: 18px; left: 0; right: 0; text-align: center;
  color: rgba(233,238,244,.5); font-size: 12.5px; letter-spacing: .04em;
}
.login-card { width: 100%; max-width: 400px; padding: 34px 32px; }
.login-card .logo { font-family: var(--font-display); font-weight: 700; font-size: 30px;
  display: flex; align-items: center; }
.login-card .logo .dot { color: var(--tape); }
.login-card .logo .mark { width: 30px; height: 30px; margin-right: 10px; }
.login-card .claim { color: var(--ink-soft); font-size: 14px; margin: 6px 0 22px; line-height: 1.5; }
.login-card .err { background: #FBE9E7; color: var(--danger); border-radius: 8px; padding: 10px 13px; font-size: 13.5px; margin-top: 12px; display: none; }
.login-strip { display: flex; gap: 6px; margin: 0 -32px 24px; height: 8px; }
.login-strip i { flex: 1; }
.login-demo { text-align: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Heute-Dashboard ---------- */
.heute-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.heute-zeile {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; cursor: pointer; border-radius: 6px;
}
.heute-zeile:hover { background: var(--brand-soft); }
.chipdot { width: 11px; height: 15px; border-radius: 3px; flex: 0 0 11px; background: var(--sw, var(--ink-faint)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.14); }
.heute-warn { border-left: 4px solid var(--tape); }

/* ---------- Plantafel ---------- */
table.plantafel { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.plantafel th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint);
  font-weight: 700; padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: center;
}
table.plantafel th span { display: block; font-size: 11.5px; color: var(--ink-soft); text-transform: none; letter-spacing: 0; margin-top: 1px; }
table.plantafel th.heute, table.plantafel td.heute { background: var(--brand-soft); }
table.plantafel td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 5px 5px; vertical-align: top; min-width: 108px; height: 56px; cursor: pointer; }
table.plantafel td:hover { background: #F3F6FA; }
table.plantafel td.pt-name, table.plantafel th.pt-name { cursor: default; border-left: 0; text-align: left; padding: 9px 12px; min-width: 130px; white-space: nowrap; }
table.plantafel td.pt-name span { display: block; font-size: 11px; color: var(--ink-faint); }
table.plantafel td.pt-frei, table.plantafel th.pt-frei { cursor: default; text-align: center; min-width: 52px; font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
table.plantafel td.pt-frei .gruen { color: var(--st-fertig); font-weight: 700; }
.pt-chip {
  display: block; width: 100%; text-align: left; margin-bottom: 4px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sw, var(--ink-faint));
  border-radius: 6px; padding: 4px 7px; font-size: 11.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.pt-chip:hover { box-shadow: var(--shadow); }
.pt-chip.abw { border-left-width: 4px; color: #fff; font-weight: 700; }
.pt-chip.abw.krank    { background: var(--danger); border-color: var(--danger); }
.pt-chip.abw.urlaub   { background: var(--st-geplant); border-color: var(--st-geplant); }
.pt-chip.abw.schulung { background: var(--tape); border-color: var(--tape); color: #4A3608; }
.pt-chip.abw.sonstig  { background: var(--ink-faint); border-color: var(--ink-faint); }

/* ---------- Finanzen (Nina) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 15px 17px; }
.kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-faint); font-weight: 700; }
.kpi .z { font-family: var(--font-display); font-size: 25px; font-weight: 700; margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--ink-soft); }
.fin-h { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.balken-reihe { display: flex; gap: 14px; align-items: stretch; height: 150px; padding-top: 18px;
  border-bottom: 2px solid var(--line); }
.balken-spalte { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; min-width: 0; }
.balken { width: 100%; max-width: 58px; background: var(--brand); border-radius: 5px 5px 0 0; }
.balken-wert { font-size: 10.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.balken-label { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
table.list.plain { box-shadow: none; border: 1px solid var(--line); }
.chat-box.team { height: min(68vh, 640px); }

/* ---------- v2: Filter-Chips, Suche, Chat-Extras, Einsätze ---------- */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 14px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.chip-btn .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-btn.on .dot { outline: 1.5px solid rgba(255,255,255,.7); }

.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-left: 4px; }
.ampel.gruen { background: var(--st-fertig); }
.ampel.rot { background: var(--danger); }

.extern-toggle {
  background: none; border: 1px solid var(--line); border-radius: 99px;
  font-size: 10px; font-weight: 700; color: var(--ink-faint);
  padding: 1px 8px; margin-left: 6px; cursor: pointer; letter-spacing: .3px;
}
.extern-toggle.on { background: #E4F3EB; border-color: #2E7C53; color: #2E7C53; }
.msg.hit .bubble { outline: 3px solid var(--tape); }
.icon-btn.rec { background: var(--danger) !important; color: #fff !important; animation: pulse 1.2s infinite; font-weight: 700; }
@keyframes pulse { 50% { opacity: .65; } }

.suche-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 55;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lift); overflow: hidden; max-height: 300px; overflow-y: auto;
}
.suche-drop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 9px 12px; font-size: 13px; text-align: left; color: var(--ink);
}
.suche-drop button:hover { background: var(--brand-soft); }
.suche-drop button small { display: block; color: var(--ink-faint); font-size: 11.5px; }
.suche-drop .q {
  flex: 0 0 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.suche-drop .q.k { background: var(--brand); }
.suche-drop .q.a { background: var(--st-angebot_raus); }

.gs-hit {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 8px; font-size: 14px; text-align: left; color: var(--ink); border-radius: 8px;
}
.gs-hit:hover { background: var(--brand-soft); }
.gs-hit small { color: var(--ink-faint); font-size: 12px; }
.gs-hit .badge { flex: 0 0 auto; }

.einsatz-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; margin-bottom: 10px; cursor: pointer;
  transition: box-shadow .12s;
}
.einsatz-card:hover { box-shadow: var(--shadow-lift); }

.pos-table tr.markiert td { background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(140,147,163,.05) 8px, rgba(140,147,163,.05) 16px); }
.tool.on { background: var(--brand) !important; color: #fff !important; }

/* ---------- Druckansicht Angebot ---------- */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; font-size: 12.5px; color: #111; }
  #print-area .ph { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
  #print-area .ph .firm { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
  #print-area .ph .firm small { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 10.5px; color: #555; margin-top: 4px; line-height: 1.5; }
  #print-area .addr { margin: 22px 0 6px; line-height: 1.5; }
  #print-area h1 { font-size: 17px; margin: 24px 0 4px; }
  #print-area .meta-line { color: #555; font-size: 11px; margin-bottom: 16px; }
  #print-area table { width: 100%; border-collapse: collapse; margin-top: 10px; }
  #print-area th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1.5px solid #111; padding: 6px 6px; }
  #print-area td { padding: 7px 6px; border-bottom: .5px solid #ccc; vertical-align: top; }
  #print-area td.num, #print-area th.num { text-align: right; white-space: nowrap; }
  #print-area td .desc { color: #555; font-size: 11px; margin-top: 2px; }
  #print-area .titelzeile td { font-weight: 700; border-bottom: 1px solid #888; background: #f4f4f4; }
  #print-area .sums { margin-left: auto; margin-top: 14px; width: 280px; }
  #print-area .sums div { display: flex; justify-content: space-between; padding: 4px 6px; }
  #print-area .sums .tot { font-weight: 700; font-size: 14px; border-top: 1.5px solid #111; margin-top: 4px; padding-top: 7px; }
  #print-area .note { margin-top: 26px; line-height: 1.55; white-space: pre-wrap; }
  #print-area .foot { margin-top: 40px; padding-top: 10px; border-top: .5px solid #999; font-size: 9.5px; color: #666; display: flex; justify-content: space-between; }
}
