/* ════════════════════════════════════════════════════════════════════
   Angebotswerk – Oberfläche „Werkplan“
   Leitidee: die App sieht aus wie gutes Planpapier. Grafit-Linien, Glasblau
   aus den Skizzen, die Firmenfarbe (--green / --brand) nur als Akzent.
   Wird NACH style.css und saas.css geladen und überschreibt diese gezielt.
   ════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Archivo';
  font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'), url(fonts/archivo-latin-wdth-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: 'Archivo';
  font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations'), url(fonts/archivo-latin-ext-wdth-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;
}

:root {
  --ink: #1c2630;          /* Grafit – Text, Linien */
  --muted: #5f6b77;        /* Schiefer – Nebeninfos */
  --paper: #f3f4f1;        /* Planpapier – App-Hintergrund */
  --surface: #ffffff;
  --line: #e0e3df;         /* Haarlinie */
  --line-strong: #cdd2cd;
  --glass: #e4eef6;        /* Glasblau aus den Skizzen */
  --glass-ink: #2c5f86;
  --brand-tint: color-mix(in srgb, var(--green) 8%, #fff);
  --brand-tint-2: color-mix(in srgb, var(--green) 15%, #fff);
  --ai: #2c6a94; --ai-pale: #e6f0f7;
  --radius: 10px;
  --font: 'Archivo', 'Segoe UI', -apple-system, system-ui, sans-serif;
  --sidebar-w: 248px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--green) 70%, #fff); outline-offset: 2px; }

/* ─── Seitenleiste ─────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.sidebar-logo {
  text-align: left;
  padding: 20px 20px 14px;
  border-bottom: 0;
}
.sidebar-logo .logo-text {
  font-size: 19px !important;
  font-weight: 700;
  font-stretch: 88%;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--ink);
}
.sidebar-logo .logo-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
  color: var(--muted);
}
.sidebar-cta {
  margin: 4px 14px 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green);
  color: #fff !important;
  font-weight: 600; font-size: 14px;
  text-decoration: none;
}
.sidebar-cta:hover { filter: brightness(1.08); }
.sidebar-cta svg { width: 17px; height: 17px; }

.sidebar-nav { padding: 6px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group-title {
  padding: 0 12px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.nav-item {
  position: relative;
  gap: 11px;
  padding: 7px 12px;
  margin-bottom: 1px;
  border-radius: 7px;
  color: #33404c;
  font-size: 14px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #f1f3f1; color: var(--ink); }
.nav-item.active {
  background: var(--brand-tint);
  color: var(--green);
  font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--green);
}
.nav-item .nav-icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; font-size: 0; }
.nav-item .nav-icon svg { width: 18px; height: 18px; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--glass-ink);
  background: var(--glass); padding: 1px 7px; border-radius: 10px;
}

.sidebar-footer { border-top: 1px solid var(--line); padding: 12px 10px; }
.user-avatar { background: var(--glass); color: var(--glass-ink); font-weight: 700; }
.user-name { color: var(--ink); }
.user-role { opacity: 1; color: var(--muted); }
.logout-btn { opacity: 1 !important; color: var(--muted) !important; }
.logout-btn:hover { color: var(--ink) !important; }

/* ─── Inhalt ───────────────────────────────────────────────── */
.main-content { padding: 26px 36px 48px; }
.page-header { margin-bottom: 22px; align-items: flex-end; }
.page-title {
  font-size: 26px;
  font-weight: 700;
  font-stretch: 92%;
  letter-spacing: -.015em;
  color: var(--ink);
  line-height: 1.2;
}

/* Karten: Haarlinie statt Schatten */
.card, .stat-card, .ki-panel, .ki-tile, .plan-card {
  border: 1px solid var(--line);
  box-shadow: none;
  border-radius: var(--radius);
}
.card-header {
  font-size: 15px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}
.stat-card { transition: border-color .15s; }
.stat-card:hover { transform: none; border-color: var(--line-strong); }
.stat-icon { background: var(--glass); border-radius: 9px; }
.stat-value { color: var(--ink); font-weight: 700; font-stretch: 92%; letter-spacing: -.01em; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* Tabellen */
.data-table { font-size: 14px; }
.data-table thead th {
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}
.data-table tbody td { border-bottom: 1px solid var(--line); }
.data-table tbody tr:hover { background: #f7f8f6; }
.data-table .actions a, .data-table .actions button { border-color: var(--line-strong); color: #3a4652; border-radius: 6px; }

/* Schaltflächen */
.btn { border-radius: 8px; font-weight: 600; letter-spacing: 0; padding: 9px 16px; }
.btn-primary { background: var(--green); }
.btn-primary:hover { background: var(--green); filter: brightness(1.1); transform: none; box-shadow: none; }
.btn-outline { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-outline:hover { background: #f5f6f4; border-color: var(--muted); }
.btn-ghost { background: var(--brand-tint); color: var(--green); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--brand-tint-2); }

/* Formulare */
.fg label, .auth-body label {
  font-size: 13px;
  font-weight: 600;
  color: #33404c;
  text-transform: none;
  letter-spacing: 0;
}
.fg input, .fg select, .fg textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}
.search-input { border: 1px solid var(--line-strong); background: var(--surface); }

/* Status-Badges */
.badge { font-weight: 600; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.badge-gesendet { background: var(--glass); color: var(--glass-ink); }
.badge-angenommen { background: var(--brand-tint); color: var(--green); }

/* Reiter */
.tabs { border-bottom: 1px solid var(--line); }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }

/* Hinweise */
.alert { border-radius: 8px; }
.alert-info { background: var(--glass); color: var(--glass-ink); border-color: #c9dceb; }
.saas-banner { border-radius: 8px; border: 1px solid transparent; }
.saas-banner.trial { background: var(--glass); color: var(--glass-ink); border-color: #cfe0ee; }

/* KI-Bausteine im Glasblau statt Lila */
.ki-tile:hover { border-color: var(--glass-ink); box-shadow: none; }
.ki-btn { background: var(--glass-ink); border-radius: 8px; }
.ki-btn.secondary { background: var(--surface); color: var(--glass-ink); border: 1px solid var(--glass-ink); }
.ki-out th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.meter > span { background: var(--glass-ink); }
.plan-price { font-stretch: 90%; letter-spacing: -.02em; }

/* Mobile Menü-Knopf passend zur hellen Leiste */
.mobile-menu-toggle { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 2px 10px rgba(28,38,48,.08); }
@media (max-width: 900px) {
  .sidebar { box-shadow: 8px 0 30px rgba(28,38,48,.14); }
  .main-content { padding: 64px 14px 24px; }
  .page-header { align-items: flex-start; }
  .page-title { font-size: 21px; }
  .sidebar-logo { padding: 18px 16px 12px 66px; min-height: 64px; }
}

/* ─── Anmelden / Registrieren ──────────────────────────────── */
.auth-page { font-family: var(--font); background: var(--paper); }
.auth-shell {
  width: 100%; max-width: 940px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.auth-shell .auth-card { box-shadow: none; border-radius: 0; max-width: none; }
.auth-plan {
  position: relative;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    #f8f9f7;
  border-right: 1px solid var(--line);
  padding: 34px 34px 28px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.auth-plan-title {
  font-size: 30px; line-height: 1.12; font-weight: 700; font-stretch: 86%;
  letter-spacing: -.02em; color: var(--ink); margin: 0; max-width: 15ch;
}
.auth-plan-sub { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; max-width: 36ch; }
.auth-plan-sketch {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px; align-self: flex-start; width: min(100%, 330px);
}
.auth-plan-sketch svg { display: block; width: 100%; height: auto; }
.auth-plan-foot { font-size: 12.5px; color: var(--muted); }
.auth-header { background: transparent; color: var(--ink); text-align: left; padding: 34px 32px 6px; }
.auth-logo { font-size: 22px; font-weight: 700; font-stretch: 90%; letter-spacing: -.01em; }
.auth-header p { text-transform: none; letter-spacing: 0; opacity: 1; color: var(--muted); font-size: 13.5px; }
.auth-body { padding: 18px 32px 26px; }
.auth-body input, .auth-body select { border: 1px solid var(--line-strong); border-radius: 8px; }
.auth-body input:focus { border-color: var(--green, #004526); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #004526) 14%, transparent); }
.auth-btn { border-radius: 8px; font-weight: 600; }
.auth-footer { text-align: left; padding: 0 32px 22px; color: var(--muted); }
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 460px; }
  .auth-plan { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 22px; }
  .auth-plan-title { font-size: 24px; }
  .auth-plan-sketch { display: none; }
  .auth-header, .auth-body, .auth-footer { padding-left: 22px; padding-right: 22px; }
}

@media print {
  .sidebar { display: none !important; }
}

/* ─── Übersicht ────────────────────────────────────────────── */
.kpi-strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 20px; overflow: hidden;
}
.kpi { padding: 16px 18px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 700; font-stretch: 88%; letter-spacing: -.015em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-alert { background: #fdf3f2; }
.kpi.is-alert .kpi-value { color: #b42318; }
.kpi-link { font-size: 12.5px; font-weight: 600; color: #b42318; }
@media (max-width: 1200px) { .kpi-strip { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(4) { border-left: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 600px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } .kpi { border-left: 0; border-top: 1px solid var(--line); } .kpi:nth-child(odd) { border-right: 1px solid var(--line); } .kpi:nth-child(-n+2) { border-top: 0; } .kpi-value { font-size: 20px; } }

.card-header svg { color: var(--glass-ink); }
.signal-list { list-style: none; margin: 0; padding: 4px 0; }
.signal { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.signal:first-child { border-top: 0; }
.signal-ico { color: var(--glass-ink); padding-top: 2px; }
.signal.is-urgent .signal-ico, .signal.is-urgent strong { color: #b42318; }
.signal.is-good .signal-ico { color: var(--green); }
.signal > a { font-weight: 600; font-size: 13.5px; color: var(--green); white-space: nowrap; text-decoration: none; }
.signal > a:hover { text-decoration: underline; }
.signal-meta { display: block; color: var(--muted); font-size: 13px; }
.signal-text { display: block; color: #3a4652; font-size: 13.5px; margin-top: 2px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--glass); color: var(--glass-ink); margin-left: 6px; vertical-align: 1px; }
.list-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: inherit; margin: 0 -10px 2px; }
.list-link:hover { background: #f5f6f4; }
.avatar-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--glass); color: var(--glass-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 34px; }
.empty-state p { max-width: 42ch; margin-left: auto; margin-right: auto; }
.main-content a:not([class]) { color: var(--glass-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.main-content a:not([class]):hover { color: var(--ink); }

/* ─── Projektleitung ───────────────────────────────────────── */
.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c9cfd5; flex: 0 0 10px; vertical-align: 1px; }
.ampel-gruen { background: #2f9e58; } .ampel-gelb { background: #e0a106; } .ampel-rot { background: #c8321f; box-shadow: 0 0 0 3px #f8d9d4; }
.pj-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 14px; margin-bottom: 16px; }
.pj-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.pj-desc { margin: 8px 0 0; color: #3a4652; font-size: 14px; max-width: 80ch; }
.pj-phasen { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; counter-reset: ph; }
.pj-phasen li { position: relative; padding-top: 12px; font-size: 12px; color: var(--muted); text-align: left; min-width: 0; }
.pj-phasen li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--line); }
.pj-phasen li.done::before { background: color-mix(in srgb, var(--green) 55%, #fff); }
.pj-phasen li.now::before { background: var(--green); }
.pj-phasen li.now { color: var(--ink); font-weight: 650; }
.pj-phasen li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .pj-phasen { grid-template-columns: repeat(5, 1fr); row-gap: 10px; } }
.pj-kpis { margin-bottom: 16px; }
.pj-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pj-grid { grid-template-columns: 1fr; } }
.pj-grid > .card { margin-bottom: 0; }
.tab-content > .card, .tab-content > section.card { margin-top: 16px; }
.pl-card .card-header { gap: 8px; }
.pl-ki-btn { margin-left: auto; }
.pl-lage { margin: 0 0 6px; font-size: 14.5px; line-height: 1.55; }
.pl-h { margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
.pl-h.ueberf, .ueberf { color: #b42318 !important; }
.pl-list { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.pl-list li { margin: 2px 0; }
.pl-vorschlaege li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.pl-ok { color: var(--muted); margin: 4px 0; font-size: 14px; }
.pl-err { color: #b42318; margin: 0; }
.pl-datum { margin: -10px 0 16px; color: var(--muted); }
.pl-tag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--glass-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.pl-hinweise { list-style: none; margin: 0; padding: 0; }
.pl-hinweise li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pl-hinweise li:first-child { border-top: 0; }
.pl-hinweise li span { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.pl-hinweise li > a { font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; white-space: nowrap; }
.pl-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: #9aa6b1; }
.st-krit .pl-dot { background: #c8321f; } .st-hoch .pl-dot { background: #e0a106; } .st-normal .pl-dot { background: var(--glass-ink); } .st-info .pl-dot { background: #b8c2cb; }
.st-krit strong { color: #9b2416; }
.st-txt { font-size: 13.5px; } .st-txt.st-krit { color: #9b2416; font-weight: 600; } .st-txt.st-hoch { color: #7a5600; }
.tag-rot { background: #fbe1dc; color: #9b2416; }
.mini-phasen { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 120px; margin-bottom: 3px; }
.mini-phasen i { height: 5px; border-radius: 2px; background: var(--line); }
.mini-phasen i.on { background: var(--green); }
.aufg-neu { display: grid; grid-template-columns: 1fr 130px 140px 100px auto; gap: 8px; margin-bottom: 12px; }
.aufg-neu input, .aufg-neu select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; min-width: 0; }
@media (max-width: 760px) { .aufg-neu { grid-template-columns: 1fr 1fr; } .aufg-neu input[name=titel] { grid-column: 1 / -1; } }
.aufg-list { list-style: none; margin: 0; padding: 0; }
.aufg-list li { padding: 9px 0 9px 10px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.aufg-list li:first-child { border-top: 0; }
.aufg-list li.prio-hoch { border-left-color: #e0a106; }
.aufg-list label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: 14.5px; }
.aufg-list input[type=checkbox] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--green); flex: 0 0 17px; }
.aufg-list .done .aufg-t, .aufg-list li.done .aufg-t { text-decoration: line-through; color: var(--muted); }
.aufg-m { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 3px 0 0 26px; font-size: 12.5px; color: var(--muted); }
.aufg-m a { color: var(--glass-ink); font-weight: 600; text-decoration: none; }
.aufg-m .heute { color: var(--green); font-weight: 600; }
.aufg-d { display: block; margin: 3px 0 0 26px; font-size: 13px; color: #4a5562; }
.aufg-erl { margin-top: 12px; } .aufg-erl summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.ablauf { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.ablauf li { position: relative; padding: 0 0 12px 14px; font-size: 14px; }
.ablauf li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); }
.ablauf li.past::before { background: var(--line-strong); }
.ablauf li.today::before { background: var(--green); border-color: var(--green); }
.ablauf time { display: inline-block; min-width: 88px; color: var(--muted); font-size: 13px; }
.ablauf strong { font-weight: 600; margin-right: 8px; }
.ablauf span { color: var(--muted); font-size: 13px; }
.abnahme-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.abnahme-form input { border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; font: inherit; margin-left: 6px; }

/* ─── Aufmaß-Fotos ─────────────────────────────────────────── */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.foto-tile { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f4f5f3; aspect-ratio: 4 / 3; }
.foto-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.foto-tile .foto-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; padding: 6px; background: linear-gradient(transparent, rgba(20,28,36,.72)); }
.foto-tile .foto-bar button { background: rgba(255,255,255,.92); border: 0; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 8px; cursor: pointer; color: var(--ink); }
.foto-tile .foto-mass { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,.92); border-radius: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 6px; color: var(--ink); }
.foto-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--line-strong); border-radius: 8px; aspect-ratio: 4 / 3; color: var(--muted); font-size: 13px; cursor: pointer; background: #fafbf9; text-align: center; padding: 6px; }
.foto-add:hover { border-color: var(--green); color: var(--green); }
.foto-add input { display: none; }
.aufm-fotos-row td { background: #fafbf9; }

/* Foto-Editor (Maße einzeichnen) */
.afe { position: fixed; inset: 0; z-index: 1000; background: #11181f; color: #fff; display: flex; flex-direction: column; }
.afe-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: #1b252f; }
.afe-title { font-weight: 650; margin-right: 6px; }
.afe-tools { display: flex; gap: 4px; background: #26323e; border-radius: 9px; padding: 3px; }
.afe button { background: transparent; color: #e7ecf1; border: 0; border-radius: 7px; padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 38px; }
.afe-tools button.on { background: #ffd400; color: #1c2630; }
.afe-right { margin-left: auto; display: flex; gap: 6px; }
.afe-right button { background: #2f3c48; }
.afe-right .afe-save { background: #ffd400; color: #1c2630; }
.afe-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px; min-height: 0; }
.afe-stage canvas { touch-action: none; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.5); cursor: crosshair; }
.afe-input { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: #fff; color: var(--ink); border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.afe-input[hidden] { display: none; }
.afe-input label { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.afe-input input { width: 120px; font-size: 18px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 700; text-align: center; }
.afe-input button { background: var(--ink); color: #fff; }
.afe-input button[data-act=cancel] { background: #eef0ee; color: var(--ink); }
.afe-hint { margin: 0; padding: 8px 14px 12px; color: #a9b4bf; font-size: 13px; text-align: center; }
.aufg-neu { grid-template-columns: 1fr 1fr 1fr auto; }
.aufg-neu input[name=titel] { grid-column: 1 / -1; }
.pl-sum { margin: 0 0 6px; font-size: 14px; color: #3a4652; }

/* ── Sicherheit ── */
.tag-ok{background:#dff0e4;color:#245c39}
.sec-form{display:grid;gap:10px;max-width:420px}
.sec-form .fg{margin:0}
.sec-inline{grid-template-columns:1fr auto;align-items:end;max-width:560px}
.sec-qr{width:200px;height:200px;background:#fff;padding:6px;border-radius:8px;border:1px solid var(--line, #dde3ea);margin:6px 0 10px}
.sec-qr svg{width:100%;height:100%;display:block}
.sec-key{font-size:14px;letter-spacing:.06em;word-break:break-all}
.sec-steps{margin:0 0 4px;padding-left:18px}
.sec-codes{columns:2;font-size:16px;padding-left:22px;margin:10px 0 14px}
.sec-codes li{margin:4px 0}
.sec-aus{margin-top:14px}
.sec-aus summary{cursor:pointer;color:var(--muted)}
@media print{.sidebar,.page-header,.card:not(.sec-backup){display:none!important}}
/* Seitenleisten-Fuß auf dem Handy untereinander (ragte sonst aus der eingeklappten Leiste) */
@media (max-width: 900px) {
  .sidebar { overflow: hidden; }
  .sidebar-footer { display: block !important; }
}

/* ── DATEV ── */
.datev-zeit{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.datev-zeit .fg{margin:0}
.datev-schnell{display:flex;gap:12px;font-size:13px}
.datev-sum{margin:14px 0 8px}
.datev-export{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.datev-einst{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-top:14px}
.datev-einst .fg{margin:0}
.datev-einst-foot{grid-column:1/-1;display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.table-scroll{overflow-x:auto}

/* ── Meine Baustelle ── */
.bs-lang{display:inline-flex;border:1px solid var(--line-strong);border-radius:8px;overflow:hidden}
.bs-lang button{font:inherit;font-size:12.5px;font-weight:600;padding:6px 10px;border:0;background:var(--surface,#fff);color:var(--muted);cursor:pointer}
.bs-lang button.on{background:var(--ink);color:#fff}
.bs-sec{margin-bottom:22px}
.bs-h{font-size:16px;margin:0 0 10px}
.bs-h3{font-size:13.5px;margin:14px 0 6px}
.bs-card{display:flex;gap:14px;background:var(--surface,#fff);border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:10px}
.bs-card.heute{border-left:4px solid var(--brand,var(--green))}
.bs-zeit{min-width:64px;display:flex;flex-direction:column;font-size:12px;color:var(--muted)}
.bs-zeit strong{font-size:20px;color:var(--ink);font-variant-numeric:tabular-nums}
.bs-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.bs-main>strong{font-size:15.5px}
.bs-sub{font-size:13px;color:var(--muted)}
.bs-btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.bs-btns .btn{min-height:40px}
.bs-fotos{margin-top:10px}
.bs-notiz{display:grid;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.bs-notiz span{display:block;font-size:12.5px;font-weight:600;margin-bottom:4px}
.bs-notiz textarea{width:100%;font:inherit;font-size:15px;padding:9px 11px;border:1px solid var(--line-strong);border-radius:8px}
.bs-notiz .btn{justify-self:start}
.abnahme-box{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.abnahme-box>div{flex-basis:100%}
.abnahme-ohne{flex-basis:100%;font-size:13px}
.abnahme-ohne summary{cursor:pointer;color:var(--muted)}
.abnahme-ohne .abnahme-form{border-top:0;padding-top:4px}
@media (max-width:600px){.bs-card{flex-direction:column;gap:6px}.bs-zeit{flex-direction:row;gap:8px;align-items:baseline}}

/* ════════════════════════════════════════════════════════════════════
   Termine: Monatskalender + Agenda
   ════════════════════════════════════════════════════════════════════ */
.st-geplant { --st: #2c5f86; } .st-bestaetigt { --st: var(--green); } .st-erledigt { --st: #8a949e; } .st-storniert { --st: #b42318; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { padding: 0; overflow: hidden; margin: 0; }
.cal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cal-titel { order: -1; flex: 1; margin: 0; font-size: 20px; font-weight: 700; font-stretch: 88%; letter-spacing: -.01em; }
.cal-titel span { color: var(--muted); font-weight: 500; }
.cal-nav, .cal-heute { display: inline-grid; place-items: center; height: 36px; min-width: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 20px; line-height: 1; }
.cal-heute { font-size: 13px; font-weight: 600; }
.cal-nav:hover, .cal-heute:hover { border-color: var(--ink); }
.cal-kopf { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-kopf span { padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cal-kopf .we { color: #98a1aa; }
.cal-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-tag { position: relative; min-width: 0; min-height: 108px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-tag:nth-child(7n) { border-right: 0; }
.cal-tag.we { background: #fafbf9; }
.cal-tag.leer { background: var(--paper); }
.cal-nr { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.cal-tag.vorbei .cal-nr { color: #98a1aa; }
.cal-tag.heute .cal-nr { background: var(--green); color: #fff; }
.cal-nr:hover { background: var(--brand-tint-2); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.cal-chip { display: block; padding: 3px 6px; border-radius: 5px; border-left: 3px solid var(--st); background: color-mix(in srgb, var(--st) 11%, #fff);
  color: var(--ink); font-size: 11.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-chip b { font-weight: 650; color: var(--st); font-variant-numeric: tabular-nums; }
.cal-chip.st-storniert { text-decoration: line-through; opacity: .75; }
.cal-chip:hover { background: color-mix(in srgb, var(--st) 20%, #fff); }
.cal-mehr { font-size: 11px; color: var(--muted); text-decoration: none; padding-left: 4px; }
.cal-plus { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); text-decoration: none; opacity: 0; font-size: 14px; }
.cal-tag:hover .cal-plus, .cal-plus:focus-visible { opacity: 1; }
.cal-plus:hover { background: var(--brand-tint); color: var(--green); }
.cal-punkte { display: none; }
.cal-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; font-size: 12px; color: var(--muted); }
.cal-legende i, .cal-punkte i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st); margin-right: 6px; vertical-align: 1px; }

.agenda-titel { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 2px 10px; font-size: 16px; font-weight: 700; font-stretch: 90%; }
.agenda-titel small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.agenda-tag { margin-bottom: 14px; scroll-margin-top: 76px; }
.agenda-tag h3 { margin: 0 2px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.agenda-wt { color: var(--ink); }
.agenda-tag.heute .agenda-wt { color: var(--green); }
.agenda-tag:target .termin { box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 35%, transparent); }
.agenda-leer { padding: 18px; text-align: center; color: var(--muted); }
.agenda-leer p { margin: 0 0 10px; }
.termin { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; align-items: start; margin-bottom: 6px; padding: 11px 8px 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--st); border-radius: 10px; }
.termin-zeit strong { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.termin-zeit span { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.termin-titel { display: block; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.32; overflow-wrap: anywhere; }
.termin-titel:hover { text-decoration: underline; }
.termin.st-storniert .termin-titel { text-decoration: line-through; color: var(--muted); }
.termin-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.termin-status { color: var(--st); font-weight: 600; }
.termin-ort { display: inline-block; margin-top: 4px; font-size: 12.5px; color: var(--glass-ink); overflow-wrap: anywhere; }
.termin-akt { display: flex; flex-direction: column; gap: 2px; }
.termin-akt .btn { min-height: 32px !important; min-width: 34px; padding: 4px 6px !important; font-size: 14px !important; border: 0; background: none; }
.termin-akt .btn:hover { background: var(--paper); }

@media (max-width: 720px) {
  .cal-bar { padding: 10px 10px 8px 14px; }
  .cal-titel { font-size: 18px; }
  .cal-kopf { border-bottom: 0; padding: 0 6px; }
  .cal-kopf span { text-align: center; padding: 4px 0 2px; font-size: 11px; }
  .cal-raster { padding: 0 6px 6px; }
  .cal-tag { min-height: 46px; padding: 2px 0 4px; border: 0; background: none !important; display: flex; flex-direction: column; align-items: center; }
  .cal-tag.leer { background: none; }
  .cal-nr { width: 36px; height: 36px; font-size: 14.5px; font-weight: 500; }
  .cal-tag.hat .cal-nr { font-weight: 700; }
  .cal-tag.we:not(.heute) .cal-nr { color: #8a949e; }
  .cal-chips, .cal-plus { display: none; }
  .cal-punkte { display: flex; gap: 3px; height: 5px; }
  .cal-punkte i { width: 5px; height: 5px; margin: 0; }
  .cal-legende { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 11.5px; gap: 4px 12px; }
  .termin { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 10px 4px 10px 10px; }
  .termin-titel { font-size: 15px; }
}

/* ════════════════════════════════════════════════════════════════════
   Handy & Tablet: App-Leiste oben, Tab-Leiste unten, Tabellen als Karten
   ════════════════════════════════════════════════════════════════════ */
.tabbar { display: none; }
@media (max-width: 900px) {
  .has-tabbar .mobile-menu-toggle { display: none !important; }
  .main-content { padding: 0 12px calc(84px + env(safe-area-inset-bottom)) !important; }
  .page-header {
    position: sticky; top: 0; z-index: 90;
    margin: 0 -12px 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    flex-direction: row !important; flex-wrap: wrap; align-items: center !important; gap: 8px 10px !important;
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .page-header h1, .page-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 19px !important; font-weight: 700; font-stretch: 88%; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
  .page-actions { flex: 1 1 100%; display: flex; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .page-actions::-webkit-scrollbar { display: none; }
  .page-actions .btn, .page-actions a, .page-actions button { flex: 0 0 auto !important; min-height: 36px !important; padding: 7px 12px !important; font-size: 13px !important; white-space: nowrap; }
  .page-actions form { flex: 0 0 auto; display: flex; gap: 6px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 58px; padding: 6px 2px 5px; border: 0; background: none; color: var(--muted);
    font: inherit; font-size: 11px; font-weight: 550; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .on { color: var(--green); }
  .tabbar .on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--green); }
  .tabbar .on svg { stroke-width: 2.1; }
  .tabbar a:active, .tabbar button:active { background: var(--paper); }
  .sidebar { z-index: 120 !important; }
  .mobile-overlay { z-index: 110 !important; }

  .as-fab { bottom: calc(70px + env(safe-area-inset-bottom)) !important; width: 50px !important; height: 50px !important; }
  .as-pan { z-index: 130 !important; }

  .saas-banner { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px !important; font-size: 12.5px !important; line-height: 1.4; margin-bottom: 12px !important; }
  .saas-banner a { white-space: nowrap; }
  .card { margin-left: 0 !important; margin-right: 0 !important; }
  .data-table { white-space: normal; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .stats-grid > * { min-width: 0; }
  .main-content { padding-left: 10px !important; padding-right: 10px !important; }
  .page-header { margin-left: -10px; margin-right: -10px; }
}

/* ── Tabellen → Karten (assets/responsive.js setzt .rt + data-label) ── */
@media (max-width: 640px) {
  .card-body-np:has(> table.rt), .card-body-np:has(table.rt) { overflow: visible; }
  table.rt { display: block; width: 100%; min-width: 0 !important; border: 0; background: none; white-space: normal !important; }
  table.rt thead { display: none; }
  table.rt tbody, table.rt tfoot { display: block; padding: 8px 10px 4px; }
  table.rt tr { display: flex; flex-direction: column; gap: 3px; margin: 0 0 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
  .card table.rt tr { background: color-mix(in srgb, var(--paper) 45%, #fff); }
  table.rt tr:hover { background: inherit; }
  table.rt td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 1px 0 !important; border: 0 !important; text-align: right !important;
    font-size: 14px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; width: auto !important; max-width: none !important; white-space: normal !important; }
  table.rt td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  table.rt td:not([data-label])::before, table.rt td[data-label=""]::before { display: none; }
  table.rt td.rt-titel { order: -1; display: block; text-align: left !important; font-size: 15px; font-weight: 650; margin-bottom: 2px; }
  table.rt td.rt-titel::before { display: none; }
  table.rt td.rt-titel a { color: var(--ink); }
  table.rt td.rt-leer { display: none; }
  table.rt td.rt-akt, table.rt td.actions { order: 99; justify-content: flex-end; gap: 6px; margin-top: 6px; padding-top: 8px !important; border-top: 1px solid var(--line) !important; }
  table.rt td.rt-akt::before, table.rt td.actions::before { display: none; }
  table.rt td.rt-akt > *, table.rt td.actions > * { min-height: 36px; }
  table.rt td.rt-voll { display: block; text-align: center !important; color: var(--muted); }
  table.rt td.rt-voll::before { display: none; }
  table.rt input[type=checkbox] { width: 20px; height: 20px; }
  table.rt tfoot tr { background: var(--brand-tint); font-weight: 650; }
}

/* ── Inline-Layouts der älteren Seiten auf dem Handy ordnen ── */
@media (max-width: 900px) {
  html, body { overflow-x: clip; }
  .main-content [style*="position:sticky"][style*="bottom:0"], .main-content [style*="position: sticky"][style*="bottom: 0"] {
    bottom: calc(58px + env(safe-area-inset-bottom)) !important; z-index: 80; box-shadow: 0 -6px 18px rgba(20,28,36,.06);
  }
  .main-content select, .main-content input, .main-content textarea { max-width: 100%; }
}
@media (max-width: 600px) {
  .main-content [style*="display:flex"], .main-content [style*="display: flex"] { flex-wrap: wrap; min-width: 0; }
  .main-content [style*="display:flex"] > *, .main-content [style*="display: flex"] > * { min-width: 0; max-width: 100%; }
  /* Kennzahl-Karten nebeneinander statt untereinander */
  .main-content [style*="grid-template-columns"][style*="minmax(1"]:has(> .card, > .stat-card), .main-content [style*="grid-template-columns"][style*="minmax(2"]:has(> .card, > .stat-card) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .main-content [style*="minmax(1"]:has(> .card) > .card, .main-content [style*="minmax(2"]:has(> .card) > .card { margin: 0 !important; padding: 12px !important; }
}

/* ===================== Dashboard „Cockpit“ ===================== */
.main-content { --dk-s1: #2a78d6; --dk-s2: #1baf7a; }
.dk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.dk-tile { --c: #2a78d6; --c-tint: #eaf2fc; position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 16px 16px 14px; border-radius: 16px; background: var(--surface, #fff); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; overflow: hidden; isolation: isolate;
  box-shadow: 0 1px 0 rgba(28,38,48,.03), 0 8px 24px -16px color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dk-tile::before { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 14%, transparent), transparent); z-index: -1; }
.dk-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--c) 70%, transparent); }
.dk-tile:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.dk-tile.c1 { --c: #2a78d6; --c-tint: #e8f1fc; }
.dk-tile.c2 { --c: #eb6834; --c-tint: #fdeee6; }
.dk-tile.c3 { --c: #1baf7a; --c-tint: #e3f6ee; }
.dk-tile.c4 { --c: #6250d6; --c-tint: #eeebfb; }
/* Erste Kachel als dunkle Hauptkachel */
.dk-tile.c1 { background: linear-gradient(135deg, #16324f 0%, #1d4f86 55%, #2a78d6 120%); border-color: transparent; color: #fff;
  box-shadow: 0 16px 34px -18px rgba(29,79,134,.75); }
.dk-tile.c1::before { background: radial-gradient(closest-side, rgba(255,255,255,.16), transparent); }
.dk-tile.c1 .dk-ico { background: rgba(255,255,255,.14); color: #fff; }
.dk-tile.c1 .dk-head, .dk-tile.c1 .dk-foot, .dk-tile.c1 .dk-sub { color: rgba(255,255,255,.78); }
.dk-tile.c1 .dk-arrow { background: rgba(255,255,255,.12); color: #fff; }
.dk-tile.c1 .dk-seg i { background: rgba(255,255,255,.18); }
.dk-tile.c1 .dk-seg i.an { background: #8cc4ff; }
.dk-tile.c1 .dk-delta.up { background: rgba(110,231,183,.16); color: #a7f3d0; }
.dk-tile.c1 .dk-delta.down { background: rgba(252,165,165,.16); color: #fecaca; }
.dk-tile.c1 .dk-delta { background: rgba(255,255,255,.12); color: #fff; }
.dk-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.dk-ico { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--c-tint); color: var(--c); }
.dk-ico.c1 { --c: #2a78d6; --c-tint: #e8f1fc; } .dk-ico.c3 { --c: #1baf7a; --c-tint: #e3f6ee; }
.dk-ico svg { width: 18px; height: 18px; }
.dk-arrow { margin-left: auto; flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); color: var(--ink); font-size: 13px; transition: background .18s, color .18s; }
.dk-tile:not(.c1):hover .dk-arrow { background: var(--c); color: #fff; }
.dk-wert { font-size: clamp(22px, 2.2vw, 30px); font-weight: 750; font-stretch: 92%; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); min-height: 22px; }
.dk-delta { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.dk-delta.up { background: #e3f6ee; color: #0f7a53; }
.dk-delta.down { background: #fdecec; color: #b42323; }
.dk-flag { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e34948; color: #fff; }
.dk-seg { display: flex; gap: 3px; height: 26px; align-items: flex-end; margin: 8px 0 2px; }
.dk-seg i { flex: 1; min-width: 0; height: 100%; border-radius: 3px; background: var(--line); }
.dk-seg i.an { background: var(--c); }
.dk-seg i:nth-child(odd) { height: 78%; }
.dk-foot { font-size: 12px; color: var(--muted); }

.dk-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; align-items: stretch; }
.dk-row > .card { margin: 0; border-radius: 16px; }
.dk-chart-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dk-chart-head h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.dk-chart-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.dk-legende { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.dk-legende span, .dk-tip span { display: inline-flex; align-items: center; gap: 6px; }
.dk-legende i, .dk-tip i { width: 14px; height: 3px; border-radius: 2px; background: var(--dk-s1); }
.dk-legende i.l2, .dk-tip i.l2 { background: var(--dk-s2); }
.dk-chart { position: relative; width: 100%; min-height: 230px; touch-action: pan-y; }
.dk-svg { display: block; width: 100%; height: auto; overflow: visible; }
.dk-grid { stroke: var(--line); stroke-width: 1; }
.dk-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dk-ax.jetzt { fill: var(--ink); font-weight: 700; }
.dk-l1, .dk-l2 { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dk-l1 { stroke: var(--dk-s1); } .dk-l2 { stroke: var(--dk-s2); }
.dk-dot1, .dk-dot2 { stroke: var(--surface, #fff); stroke-width: 2; }
.dk-dot1 { fill: var(--dk-s1); } .dk-dot2 { fill: var(--dk-s2); }
.dk-cross { stroke: var(--ink); stroke-opacity: .35; stroke-width: 1; stroke-dasharray: 3 3; }
.dk-band { fill: var(--dk-s1); fill-opacity: .05; }
.dk-tip { position: absolute; top: 6px; z-index: 3; pointer-events: none; min-width: 170px; padding: 10px 12px; border-radius: 12px;
  background: #1c2630; color: #fff; font-size: 12.5px; line-height: 1.5; box-shadow: 0 12px 28px -12px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 2px; }
.dk-tip[hidden] { display: none; }
.dk-tip b { font-size: 12px; color: rgba(255,255,255,.7); font-weight: 600; }
.dk-tip strong { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.dk-tip span { width: 100%; }
.dk-tip em { font-style: normal; font-size: 11.5px; font-weight: 700; }
.dk-tip em.up { color: #6ee7b7; } .dk-tip em.down { color: #fca5a5; }
.dk-tabelle { margin-top: 8px; font-size: 13px; }
.dk-tabelle summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 4px 0; }
.dk-tabelle summary:hover { color: var(--ink); }
.dk-tabelle table { margin-top: 6px; }

.dk-pipe { display: flex; flex-direction: column; }
.dk-quote { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, #e3f6ee, #eef7f2 60%, #f3f4f1); }
.dk-quote strong { font-size: 34px; font-weight: 780; font-stretch: 90%; letter-spacing: -.03em; color: #0f7a53; font-variant-numeric: tabular-nums; }
.dk-quote span { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.dk-quote small { font-weight: 400; color: var(--muted); }
.dk-bars { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 11px; }
.dk-bars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 62px; align-items: center; gap: 10px; font-size: 13px; }
.dk-bl small { color: var(--muted); font-variant-numeric: tabular-nums; }
.dk-bw { height: 10px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.dk-b { display: block; height: 100%; border-radius: 999px; background: #9aa5b1; }
.dk-b.st-gesendet { background: #2a78d6; } .dk-b.st-angenommen { background: #1baf7a; } .dk-b.st-abgelehnt { background: #e34948; }
.dk-bv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.dk-schnell { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.dk-schnell .btn { flex: 1 1 auto; justify-content: center; }

.dk-typ { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 11.5px; font-weight: 800;
  background: #e8f1fc; color: #1d5fae; vertical-align: middle; }
.dk-typ.t-rechnung { background: #fdeee6; color: #b4471c; }
.dk-typ.t-abschlag { background: #eeebfb; color: #4b3bb8; }
.dk-typ.t-schluss { background: #e3f6ee; color: #0f7a53; }
.dk-typ.t-gutschrift { background: #eef0f2; color: #4b5560; }
.dk-typ.t-kostenvoranschlag { background: #fdf3d9; color: #8a5d00; }

@media (max-width: 1100px) {
  .dk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dk-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dk-tiles { gap: 10px; margin-bottom: 12px; }
  .dk-tile { padding: 12px; border-radius: 14px; gap: 4px; }
  .dk-head { font-size: 12px; gap: 7px; }
  .dk-ico { width: 28px; height: 28px; border-radius: 9px; }
  .dk-ico svg { width: 16px; height: 16px; }
  .dk-arrow { display: none; }
  .dk-wert { font-size: 19px; margin-top: 2px; }
  .dk-sub { font-size: 11.5px; min-height: 0; }
  .dk-delta, .dk-flag { font-size: 11px; padding: 1px 6px; }
  .dk-seg { height: 18px; gap: 2px; margin-top: 4px; }
  .dk-seg i:nth-child(even) { display: none; }
  .dk-foot { font-size: 11px; line-height: 1.35; }
  .dk-row { gap: 12px; margin-bottom: 12px; }
  .dk-legende { margin-left: 0; width: 100%; }
  .dk-bars li { grid-template-columns: 84px minmax(0, 1fr) 54px; font-size: 12.5px; }
  .dk-quote strong { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .dk-tile, .dk-arrow { transition: none; } .dk-tile:hover { transform: none; } }
.dk-row > .card { padding: 18px 20px; }
.dk-bv { white-space: nowrap; }
.dk-leer { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; padding: 8px 14px; border-radius: 999px;
  background: var(--surface, #fff); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .dk-row > .card { padding: 14px; } .dk-leer { font-size: 12px; white-space: normal; text-align: center; width: max-content; max-width: 80%; } }
