/* Kompaktes, flaches Erscheinungsbild nach dem Vorbild der Dichte von Close:
   14 px Grundschrift, 13 px in Listen und Navigation, 30–32 px hohe Bedienelemente,
   feine Linien statt Schatten, dunkle Seitenleiste. Farben kommen aus den Einstellungen. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --card: #ffffff;
  --line: #dfe3e8;
  --line-soft: #eceff2;
  --fill: #f8f9fa;
  --fill-strong: #eceff2;
  --muted: #596571;
  --danger: #c4261d;
  --ok: #1f7a3d;
  --link: #245bc6;
  --radius: 8px;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --side-hover: color-mix(in srgb, var(--sidebar-text) 6%, transparent);
  --side-active: color-mix(in srgb, var(--sidebar-text) 11%, transparent);
  --side-soft: color-mix(in srgb, var(--sidebar-text) 85%, transparent);
  --side-muted: color-mix(in srgb, var(--sidebar-text) 55%, transparent);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 20px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
h1 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .25px; text-transform: uppercase; margin: 0; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
strong { font-weight: 600; }

/* Grundgerüst */
body { min-height: 100vh; display: flex; flex-direction: column; }
.shell { display: flex; flex-wrap: wrap; flex: 1 1 auto; background: var(--sidebar); }
.sidebar { flex: 1 1 232px; max-width: 252px; background: var(--sidebar); color: var(--sidebar-text); padding: 12px; display: flex; flex-direction: column; gap: 1px; }
.brand { display: block; padding: 6px 8px 18px; color: var(--sidebar-text); }
.logo { display: block; width: 100%; max-width: 196px; height: auto; }
.auth-logo { color: var(--text); margin-bottom: 18px; }
.auth-logo .logo { max-width: 220px; }
/* Menü nach dem Vorbild von Close: 30 px hohe Zeilen, Icon in 20-px-Spalte, gedämpfte Schrift, aktive Zeile hell hinterlegt */
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-group-end { margin-top: auto !important; padding-top: 16px; }
.nav { display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 4px 12px 4px 8px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; line-height: 16px; font-weight: 500; text-decoration: none; color: var(--side-soft); transition: background .12s, color .12s; }
.nav .ico { flex: 0 0 20px; width: 20px; height: 14px; color: var(--side-muted); transition: color .12s; }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { background: var(--side-hover); color: var(--sidebar-text); }
.nav.is-active { background: var(--side-active); color: var(--sidebar-text); }
.nav:hover .ico, .nav.is-active .ico { color: var(--sidebar-text); }
.count { font-size: 11px; line-height: 14px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 5px; background: var(--accent); color: var(--accent-text); }
.sidebar-foot { margin-top: 8px; padding: 10px 8px 2px; font-size: 12px; line-height: 16px; border-top: 1px solid var(--side-hover); color: var(--side-soft); }
.sidebar-foot strong { color: var(--sidebar-text); }
.sidebar-foot .linklike { color: var(--side-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.sidebar-foot .linklike:hover { color: var(--sidebar-text); }
.sidebar-foot .ico { width: 12px; height: 12px; }
.linklike { background: none; border: 0; padding: 2px 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.main { flex: 999 1 560px; min-width: 0; padding: 16px 20px 40px; background: var(--bg); }

/* Breite Bildschirme: Menü bleibt beim Scrollen stehen, der Inhalt liegt wie bei Close als abgerundete Fläche daneben */
@media screen and (min-width: 840px) {
  body { --top: 0px; }
  body.has-banner { --top: 24px; }
  .env-banner { position: sticky; top: 0; z-index: 20; }
  .shell { flex-wrap: nowrap; }
  .sidebar { flex: 0 0 252px; position: sticky; top: var(--top); align-self: flex-start; height: calc(100vh - var(--top)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--side-active) transparent; }
  .main { margin: 8px 8px 8px 0; border: 1px solid var(--line); border-radius: 12px; }
}
@media print {
  .sidebar, .env-banner { display: none; }
  .shell { background: none; }
}
.auth { width: 100%; max-width: 392px; margin: 10vh auto; padding: 0 16px; }
.auth h1 { margin: 2px 0 6px; }
.auth p { margin: 0 0 14px; }

/* Flächen und Raster */
.head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card > h2:first-child { margin: -12px -12px 2px; padding: 8px 12px; background: var(--fill); border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; }
/* Abschnitte anpassen (assets/app.js): eigene Farbe und, nur für Admins, die Symbole T und Farbpalette beim Überfahren. */
section.has-sec > h2:first-child { color: color-mix(in srgb, var(--sec) 72%, #000); }
.card.has-sec { border-color: color-mix(in srgb, var(--sec) 38%, var(--line)); }
.card.has-sec > h2:first-child { background: color-mix(in srgb, var(--sec) 14%, #fff); border-bottom-color: color-mix(in srgb, var(--sec) 38%, var(--line)); }
h2.sec-editable { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; min-height: 16px; }
.sec-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.sec-label[hidden] { display: none; }
/* Ein- und ausklappen: Pfeil vor der Überschrift; eingeklappt bleibt nur die Titelzeile stehen. */
.sec-toggle { flex: 0 0 auto; width: 18px; height: 18px; margin: -1px -2px -1px -4px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sec-toggle::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .12s; opacity: .7; }
.sec-toggle:hover::before, .sec-toggle:focus-visible::before { opacity: 1; }
section.is-collapsed > h2 > .sec-toggle::before { transform: translateX(-2px) rotate(-45deg); }
section.is-collapsed > :not(h2) { display: none !important; }
.card.is-collapsed > h2:first-child { margin-bottom: -12px; border-bottom: 0; border-radius: 7px; }
.sec-tools { display: inline-flex; gap: 2px; margin: -5px -4px -5px 0; opacity: 0; transition: opacity .12s; flex: 0 0 auto; }
section:hover > h2 > .sec-tools, h2:focus-within > .sec-tools { opacity: 1; }
@media (hover: none) { .sec-tools { opacity: .7; } }
.sec-tool { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.sec-tool:hover, .sec-tool:focus-visible { background: var(--card); border-color: var(--line); }
.sec-tool-text { font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1; font-weight: 700; text-transform: none; letter-spacing: 0; }
input.sec-input[type=text] { flex: 1 1 auto; width: auto; min-height: 0; font-size: 12px; min-width: 0; font: inherit; letter-spacing: inherit; text-transform: none; color: var(--text); padding: 2px 6px; margin: -4px 0; border: 1px solid var(--link); border-radius: 6px; background: var(--card); }
.sec-pop { position: absolute; z-index: 20; top: calc(100% + 4px); right: 4px; width: 188px; padding: 10px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, .14); text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); }
.sec-swatch { width: 100%; aspect-ratio: 1; padding: 0; border: 2px solid var(--card); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.sec-swatch:hover, .sec-swatch:focus-visible { box-shadow: 0 0 0 2px var(--text); }
.sec-pop-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 12px; }
label.sec-own { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: 12px; }
label.sec-own input[type=color] { width: 26px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.between { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cols { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.col-side { flex: 1 1 300px; max-width: 400px; min-width: 0; }
.col-main { flex: 999 1 420px; min-width: 0; }
.grow { flex: 1 1 180px; min-width: 0; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 7px; font-size: 13px; color: var(--text); min-height: 32px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], input[type=search], select, textarea {
  font: inherit; font-size: 13px; line-height: 18px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; min-height: 32px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input[type=search] { background: var(--fill); border-color: transparent; }
select { appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23596571' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background-color: var(--card); }
input[type=color] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
textarea { resize: vertical; }
::placeholder { color: #7d8894; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; line-height: 18px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--fill); border-color: #cdd3da; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(.93); }
.btn-small { min-height: 24px; padding: 2px 7px; font-size: 12px; line-height: 16px; border-radius: 6px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, #fff); border-color: color-mix(in srgb, var(--danger) 35%, #fff); }

/* Umschalter */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; }
.segmented a { min-height: 26px; display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 7px; font-weight: 500; font-size: 13px; line-height: 16px; text-decoration: none; color: var(--text); }
.segmented a:hover { background: var(--fill); }
.segmented a[aria-current] { background: color-mix(in srgb, var(--accent) 11%, #fff); color: color-mix(in srgb, var(--accent) 70%, #000); font-weight: 600; }

/* Meldungen */
.flash { padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.flash-ok { background: #edf7f0; border-color: #cfe8d7; color: #17602f; }
.flash-error { background: #fdf0ef; border-color: #f3d0cd; color: #a01d16; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; line-height: 16px; }
th { text-align: left; color: var(--text); padding: 8px 12px; font-size: 12px; font-weight: 600; background: var(--fill); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
td + td, th + th { border-left: 1px solid var(--line-soft); }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: #f8f9fa; }
td a.title { font-weight: 500; text-decoration: none; }
td a.title:hover { text-decoration: underline; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }

/* Kennzeichen */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 16px; font-weight: 500; padding: 1px 6px; border-radius: 6px; background: var(--fill); color: var(--text); white-space: nowrap; }
.badge-status { --c: #5b6772; background: color-mix(in srgb, var(--c) 13%, #fff); }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge-warn { background: #fdecea; color: #a01d16; }

/* Listen in Karten, Verlauf */
.item { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.item:first-of-type { border-top: 0; padding-top: 0; }
.timeline-entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 10px; font-size: 13px; line-height: 18px; }
.timeline-entry > .grow { flex: 1 1 0; }
.timeline-entry .body { white-space: pre-wrap; margin-top: 4px; overflow-wrap: anywhere; }
.timeline-entry > .grow { min-width: 0; }
/* Original-Mails im Verlauf */
.mail-meta { margin-top: 4px; overflow-wrap: anywhere; }
.mail-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mail-att { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 12px; line-height: 16px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--fill); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.mail-att:hover { border-color: var(--link); color: var(--link); }
.mail-full { margin-top: 6px; }
/* Eingeklappte Mail: nur Betreff, Datum und Absender; ein Klick klappt sie auf. */
.mail-entry > summary { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; color: var(--text); font-weight: 400; position: relative; padding-right: 18px; }
.mail-entry > summary::after { position: absolute; right: 2px; top: 0; margin: 0; color: var(--muted); }
.mail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.mail-subject { overflow-wrap: anywhere; }
.mail-sub { overflow-wrap: anywhere; }
.badge-project { background: #e8eefb; color: #1f4a9c; white-space: normal; }
.mail-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.mail-frame { display: block; width: 100%; height: 440px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; resize: vertical; }
details > summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); list-style: none; display: inline-flex; align-items: center; min-height: 24px; }
details > summary:hover { color: var(--text); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; margin-left: 5px; }
details[open] > summary::after { content: "⌄"; }
.empty { color: var(--muted); font-size: 13px; padding: 2px 0; }

/* Initialen-Kreise */
.avatar { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 10px; font-weight: 600; letter-spacing: .2px; background: color-mix(in srgb, var(--c, #8a6d52) 16%, #fff); color: color-mix(in srgb, var(--c, #8a6d52) 75%, #000); }
.avatar-small { width: 22px; height: 22px; font-size: 9px; }
.person { display: flex; align-items: center; gap: 8px; }
.sidebar .avatar { background: color-mix(in srgb, var(--c, #8a6d52) 55%, #fff); color: #1c1b1a; }

/* Dauerhafte Kennzeichnung der Entwicklungsumgebung */
.env-banner { background: #5b3fa0; color: #fff; text-align: center; font-size: 12px; line-height: 16px; font-weight: 600; padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Auf Touch-Geräten größere Trefferflächen */
@media (pointer: coarse) {
  .nav, .btn, .segmented a, input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select { min-height: 44px; }
  .btn-small { min-height: 36px; }
}

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat-label { font-size: 12px; line-height: 16px; color: var(--muted); }
.stat-value { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; }
.stat-note { font-size: 12px; line-height: 16px; color: var(--muted); }

/* Zahlen rechtsbündig, Faktenlisten */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { text-align: right; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 13px; line-height: 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Dateiauswahl */
input[type=file] { font: inherit; font-size: 13px; color: var(--text); background: var(--card); border: 1px dashed #c6cdd5; border-radius: 8px; padding: 5px 8px; min-height: 32px; width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 12px; font-weight: 500; margin-right: 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--fill); color: var(--text); cursor: pointer; }
input[type=radio] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.badge-good { background: #e7f4ec; color: #17602f; }

/* Projektmaske: Reiter, Übersichtskarten, Preisquellen */
.tabs { display: flex; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tab-count { margin-left: 5px; font-size: 11px; line-height: 14px; font-weight: 600; min-width: 18px; text-align: center; padding: 1px 5px; border-radius: 5px; background: var(--fill-strong); color: var(--muted); }
.segmented a[aria-current] .tab-count { background: color-mix(in srgb, var(--accent) 18%, #fff); color: inherit; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; align-items: start; margin-bottom: 14px; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 18px; }
.entry-actions { margin-top: 6px; }
.entry-actions:empty { display: none; }
a.badge-project { text-decoration: none; }
a.badge-project:hover { text-decoration: underline; }
/* Ziehen und Ablegen: Dateien und E-Mails lassen sich auf den Reiter „Lieferantenpreise“ oder die Ablagefläche ziehen. */
[draggable=true] { cursor: grab; }
[draggable=true].is-dragging { opacity: .55; }
.dropzone { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 16px 12px; border: 2px dashed #c6cdd5; border-radius: var(--radius); background: var(--fill); transition: border-color .12s, background .12s; }
.dropzone.is-drop, .segmented a.is-drop { border-color: var(--accent); background: var(--accent-soft); }
.segmented a[data-drop-source] { border: 2px dashed transparent; padding: 2px 7px; }
body.is-dragging-doc .segmented a[data-drop-source] { border-color: var(--accent); }
/* Positionen und Preisvergleich */
tr.row-edit > td { padding-top: 0; padding-bottom: 6px; border-top: 0; background: var(--card); }
tr.row-edit:hover { background: none; }
tr.is-best > td { background: #f1f9f4; }
.reason { color: #a01d16; white-space: normal; text-align: right; max-width: 260px; margin-left: auto; }
td.num .small { white-space: normal; }textarea.mono, pre.import-text { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 17px; }
pre.import-text { margin: 8px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius); }
td.terms { min-width: 170px; max-width: 260px; white-space: normal; }
.reason { min-width: 150px; }
body.is-uploading { cursor: progress; }
body.is-uploading .dropzone { opacity: .6; }
/* Lieferantenpreise: Schritte, kompakte Angebotszeilen */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 20px; }
.steps .btn { margin-left: 6px; vertical-align: baseline; }
details.offer > summary { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; color: var(--text); font-weight: 400; position: relative; padding-right: 18px; width: 100%; }
details.offer > summary::after { position: absolute; right: 2px; top: 0; margin: 0; color: var(--muted); }
.offer-head { font-size: 13px; overflow-wrap: anywhere; }
details.offer[open] > summary { padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }

/* Glaskalkulator (Reiter Lieferantenpreise, assets/glas-ui.js) */
.glas-editor { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--fill); }
.glas-kasten { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--card); }
.glas-kasten > summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.glas-aufbau { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.glas-lage { padding: 8px 10px; border-left: 4px solid color-mix(in srgb, var(--accent) 55%, #fff); }
.glas-szr { padding: 6px 10px 6px 26px; background: var(--fill); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.glas-lage-nr { font-size: 12px; line-height: 16px; font-weight: 600; margin-bottom: 4px; }
.glas-szr .glas-lage-nr { align-self: center; margin: 0 6px 0 0; color: var(--muted); }
.glas-einzug { margin-top: -6px; }
.glas-basis { align-items: center; }
.glas-ergebnis { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--card); }
.glas-kacheln { display: flex; flex-wrap: wrap; gap: 8px; }
.glas-kachel { flex: 1 1 170px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--card); }
.glas-kachel.ist-stark { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, #fff); }
.glas-wert { font-size: 18px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.glas-zeilen { min-width: 560px; }
.glas-zeilen td { padding: 5px 10px; vertical-align: top; }
.glas-hinweise { font-size: 13px; line-height: 18px; border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.glas-hinweise ul { margin: 2px 0 0; padding-left: 18px; }
.glas-hinweise.ist-offen, .glas-hinweise.ist-fehler { border-left-color: var(--danger); }
.glas-hinweise.ist-vorl { border-left-color: #c98a12; }
.glas-klaes { border-top: 1px solid var(--line); padding-top: 10px; }

/* Projektbereich: quadratische Kacheln mit runden Ecken, eigene Reihenfolge durch Ziehen, Stecknadel zum Anpinnen (assets/app.js) */
.btn .ico { margin-right: 5px; }
.board-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.board-bar .board-search { flex: 1 1 260px; width: auto; min-height: 36px; border-radius: 10px; }
.board-bar select { width: auto; flex: 0 1 auto; }
.board-chips { margin: 0; padding: 2px; border-radius: 9px; background: var(--fill-strong); }
.board-chips a[aria-current] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.board-group + .board-group { margin-top: 18px; }
.board-label { display: flex; align-items: center; gap: 6px; margin: 0 0 8px 2px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .25px; text-transform: uppercase; color: var(--muted); }
.board-pinned.is-empty { display: none; }
body.is-tile-dragging .board-pinned.is-empty { display: block; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(204px, 1fr)); gap: 14px; min-height: 8px; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tiles .tile { aspect-ratio: auto; min-height: 172px; padding: 12px; border-radius: 20px; } }
.tile > * { flex: 0 0 auto; }
body.is-tile-dragging .tiles:empty { min-height: 96px; border: 2px dashed #c6cdd5; border-radius: 22px; display: flex; align-items: center; justify-content: center; }
body.is-tile-dragging .tiles:empty::before { content: attr(data-empty); color: var(--muted); font-size: 13px; padding: 0 12px; text-align: center; }
body.is-tile-dragging .tiles.is-over:empty { border-color: var(--accent); background: var(--accent-soft); }
.tile { position: relative; aspect-ratio: 1 / 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: box-shadow .18s, transform .18s, border-color .18s; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.tile:hover { box-shadow: 0 8px 22px rgba(16, 24, 40, .11); transform: translateY(-2px); }
.tile:focus-within { border-color: var(--accent); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; min-height: 28px; }
.tile-top .badge { max-width: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; }
.tile-pin-form { position: relative; z-index: 2; margin: -5px -5px 0 0; }
.tile-pin { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; opacity: .35; transition: opacity .12s, background .12s, color .12s; }
.tile-pin .ico { width: 16px; height: 16px; }
.tile:hover .tile-pin, .tile-pin:focus-visible { opacity: 1; }
.tile-pin:hover { background: var(--fill-strong); color: var(--text); }
.tile-pin[aria-pressed=true] { opacity: 1; color: var(--accent-text); background: var(--accent); }
@media (hover: none) { .tile-pin { opacity: .7; } }
a.tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; font-size: 16px; line-height: 21px; font-weight: 650; letter-spacing: -.01em; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.tile-name::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
a.tile-name:focus-visible { outline: none; }
.tile-lead { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-value { font-size: 15px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value .muted { font-size: 12px; font-weight: 500; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; font-size: 12px; line-height: 16px; color: var(--muted); }
.tile-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Ziehen: die Kachel folgt dem Zeiger, ihr Platz bleibt als Lücke sichtbar, die anderen rücken weich nach. */
.tile.is-ghost { opacity: 0; }
.board-pinned.is-empty + .board-group > .board-label { display: none; }
body.is-tile-dragging .board-pinned.is-empty + .board-group > .board-label { display: flex; }
.tile-float { position: fixed; z-index: 60; margin: 0; pointer-events: none; cursor: grabbing; transform: scale(1.05) rotate(1.2deg); box-shadow: 0 18px 44px rgba(16, 24, 40, .26); transition: none; }
.tile-float.is-landing { transition: left .18s ease, top .18s ease, transform .18s ease, box-shadow .18s ease; transform: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
body.is-tile-dragging { cursor: grabbing; }
body.is-tile-dragging .tile:hover { transform: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.board-hint { margin-top: 12px; }
.board-none { margin-top: 4px; }
.board-stats { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Fristen: Ampel wie auf dem Bon in der Küche – Grün, Gelb, Rot. Der Text sagt dasselbe wie die Farbe. */
.due { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; padding: 2px 8px 2px 7px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --d: #1f8a45; background: color-mix(in srgb, var(--d) 14%, #fff); color: color-mix(in srgb, var(--d) 62%, #000); }
.due::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--d); }
.due-yellow { --d: #d99a00; }
.due-red { --d: #d0271d; }
.due-red::before { animation: due-pulse 1.6s ease-in-out infinite; }
@keyframes due-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--d) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .due-red::before { animation: none; } .tile, .tile-float.is-landing { transition: none; } }
.tile-green { border-color: color-mix(in srgb, #1f8a45 35%, var(--line)); }
.tile-yellow { border-color: color-mix(in srgb, #d99a00 60%, var(--line)); background: color-mix(in srgb, #d99a00 5%, #fff); }
.tile-red { border-color: color-mix(in srgb, #d0271d 60%, var(--line)); background: color-mix(in srgb, #d0271d 5%, #fff); }
.count-alert { background: #d0271d; color: #fff; }
.due-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, #d0271d 30%, #fff); border-radius: 10px; background: color-mix(in srgb, #d0271d 6%, #fff); font-size: 13px; }
.due-bar a { color: var(--text); font-weight: 600; text-decoration: none; }
.due-bar a:hover { text-decoration: underline; }
.deadline-box { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.deadline-box details { text-align: left; }
.deadline-form { margin-top: 8px; padding: 10px; width: min(320px, 86vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }

/* Eingabeblatt (Neues Projekt) */
dialog.sheet { width: min(460px, calc(100vw - 32px)); padding: 20px; border: 0; border-radius: 18px; background: var(--card); color: var(--text); box-shadow: 0 24px 70px rgba(16, 24, 40, .32); }
dialog.sheet::backdrop { background: rgba(16, 24, 40, .36); backdrop-filter: blur(3px); }
.sheet-title { font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -.01em; text-transform: none; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Kundenmaske: E-Mails per Ziehen oder Regel einem Projekt zuordnen */
.contact-rule { margin-top: 6px; }
.contact-rule select { min-width: 0; }
[data-drop-project] { border-radius: 8px; transition: background .12s, box-shadow .12s; }
body.is-dragging-mail [data-drop-project] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); padding: 8px; }
[data-drop-project].is-drop { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.projects-open { display: flex; }
