/* ==========================================================================
   Baulogbuch – App
   ========================================================================== */
.blb-app-body { background: var(--paper); min-height: 100vh; font-size: 16px; }
.app-bar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top); }
.app-bar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; width: min(1180px, 100% - 28px); margin-inline: auto; }
.app-bar .brand { font-size: 1.05rem; }
.app-bar .brand-mark { width: 32px; height: 32px; }
.app-user { display: flex; align-items: center; gap: 8px; }
.app-user-name { text-align: right; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.app-user-name small { display: block; font-weight: 400; color: #9fb0c6; font-size: .75rem; }
.app-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: rgba(255,255,255,.08); }
.app-icon-btn:hover { background: rgba(255,255,255,.16); }
.app-back-home { color: #c9d3e0; font-size: .9rem; text-decoration: none; }
.app-main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.app-main > .blb-flash { width: min(1180px, 100% - 28px); margin: 16px auto 0; }
.app-wrap { width: min(1180px, 100% - 28px); margin: 0 auto; padding-top: 24px; }
@media (max-width: 560px) { .app-user-name { display: none; } }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state > .blb-icon { width: 56px; height: 56px; padding: 14px; border-radius: 16px; background: var(--paper); color: var(--ink-soft); margin: 0 auto 14px; display: block; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }
.back-link { display: inline-flex; gap: .4em; align-items: center; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .92rem; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }
.section-title { font-size: 1.2rem; margin: 26px 0 12px; }
.form-title { font-weight: 700; display: flex; gap: .5em; align-items: center; margin-bottom: 12px; }
.form-title .blb-icon { color: var(--accent); }

/* ---------- Login ---------- */
.login-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 62px); }
.login-visual { background: var(--ink) radial-gradient(circle at 20% 20%, rgba(242,113,28,.25), transparent 50%); color: #fff; display: flex; align-items: center; padding: 48px clamp(24px, 6vw, 80px); position: relative; overflow: hidden; }
.login-visual::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 36px 36px; pointer-events: none; }
.login-visual-inner { position: relative; z-index: 1; max-width: 460px; }
.login-visual h1 { font-size: clamp(2rem, 4vw, 3rem); color: #fff; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: #d5deea; }
.login-points .blb-icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.08); color: #ffb27d; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 36px 32px; }
.login-lock { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark); margin-bottom: 16px; }
.login-card form p { margin: 0 0 14px; }
.login-card form label { margin-bottom: 6px; }
.login-card .login-remember label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.login-card #wp-submit { width: 100%; padding: .95em; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 700 1rem var(--font); cursor: pointer; }
.login-card #wp-submit:hover { background: var(--accent-dark); }
.login-help { text-align: center; font-size: .9rem; margin: 10px 0 0; }
@media (max-width: 860px) { .login-screen { grid-template-columns: 1fr; } .login-visual { padding: 32px 24px; } .login-points { display: none; } .login-visual h1 { font-size: 1.8rem; margin: 0; } }

/* ---------- Ring ---------- */
.ring { --p: 0; --size: 72px; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--paper) 0); display: grid; place-items: center; flex: none; }
.ring span { width: calc(var(--size) - 14px); height: calc(var(--size) - 14px); border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; text-align: center; line-height: 1; }
.ring--lg { --size: 132px; }
.ring--lg span { font-size: 2rem; background: var(--ink-2); color: #fff; }
.ring--lg small { display: block; font-size: .7rem; font-weight: 500; color: #9fb0c6; margin-top: 4px; }
.project-hero .ring { background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }

/* ---------- Badges / Chips ---------- */
.badge { display: inline-block; padding: .25em .75em; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; background: var(--info-soft); color: var(--info); }
.badge--abnahme_laeuft { background: var(--warn-soft); color: var(--warn); }
.badge--abgenommen { background: var(--ok-soft); color: var(--ok); }
.chip { display: inline-flex; align-items: center; padding: .3em .8em; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--paper); color: var(--ink-soft); text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--err { background: var(--err-soft); color: var(--err); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--active { background: var(--ink); color: #fff; }
.t-err { color: var(--err); font-weight: 600; }
.t-warn { color: var(--warn); font-weight: 600; }

/* ---------- Dashboard ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.project-card { text-decoration: none; display: flex; flex-direction: column; gap: 14px; transition: transform .15s, box-shadow .15s; margin: 0; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-card-top { display: flex; gap: 16px; align-items: center; }
.project-card h2 { font-size: 1.15rem; margin: 6px 0 2px; }
.project-card p { margin: 0; font-size: .9rem; }
.project-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--ink-soft); }
.project-last { font-size: .82rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 12px; display: flex; gap: .4em; align-items: center; }
.project-firma { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Project Hero ---------- */
.project-hero { background: var(--ink); color: #fff; border-radius: 22px; padding: clamp(22px, 4vw, 36px); display: grid; grid-template-columns: 1fr auto; gap: 24px; position: relative; overflow: hidden; }
.project-hero::before { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(242,113,28,.28), transparent 65%); }
.project-hero h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 10px 0 4px; }
.project-meta { color: #b9c4d3; margin: 0 0 18px; }
.project-dates { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.project-dates dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #8fa0b8; }
.project-dates dd { margin: 2px 0 0; font-weight: 600; }
.project-hero-side { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.hero-counts { display: flex; flex-direction: column; align-items: center; font-size: .82rem; color: #b9c4d3; }
.hero-counts b { color: #fff; }
.project-hero-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line-dark); padding-top: 18px; }
.seal { display: inline-flex; gap: .5em; align-items: center; font-size: .85rem; padding: .45em .9em; border-radius: 999px; }
.seal--ok { background: rgba(31,138,91,.18); color: #7fe0b2; }
.seal--err { background: rgba(196,61,46,.25); color: #ffb3a9; }
@media (max-width: 680px) { .project-hero { grid-template-columns: 1fr; } .project-hero-side { flex-direction: row; justify-content: flex-start; } .ring--lg { --size: 96px; } .ring--lg span { font-size: 1.4rem; } .hero-counts { align-items: flex-start; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin: 18px 0; background: #fff; padding: 5px; border-radius: 999px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; position: sticky; top: 70px; z-index: 30; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1; text-align: center; padding: .7em 1.1em; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ink-soft); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: .4em; }
.tabs a.is-active { background: var(--ink); color: #fff; }
.dot { min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; padding: 0 6px; }

/* ---------- Gewerke ---------- */
.gewerk-list { display: grid; gap: 8px; }
.gewerk-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: 14px; padding: 14px 16px; text-decoration: none; box-shadow: 0 1px 2px rgba(15,27,45,.05); border-left: 4px solid var(--line); transition: transform .12s; }
.gewerk-row:hover { transform: translateX(2px); }
.gewerk-row.status-in_arbeit { border-left-color: var(--info); }
.gewerk-row.status-erledigt { border-left-color: var(--warn); }
.gewerk-row.status-abgenommen { border-left-color: var(--ok); }
.gewerk-row.status-maengel { border-left-color: var(--err); }
.gewerk-num { width: 32px; height: 32px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.gewerk-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gewerk-title { font-weight: 700; }
.gewerk-sub { font-size: .8rem; color: var(--ink-soft); display: flex; align-items: center; gap: .3em; flex-wrap: wrap; }
.gewerk-sub .blb-icon { width: 1em; height: 1em; }
.bar { display: block; height: 6px; background: var(--paper); border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #f79a52); border-radius: 6px; transition: width .4s; }
.status-abgenommen .bar span { background: var(--ok); }
.bar--lg { height: 12px; }
.status-pill { display: inline-block; padding: .35em .8em; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--paper); color: var(--ink-soft); white-space: nowrap; }
.status-pill--in_arbeit { background: var(--info-soft); color: var(--info); }
.status-pill--erledigt { background: var(--warn-soft); color: var(--warn); }
.status-pill--abgenommen { background: var(--ok-soft); color: var(--ok); }
.status-pill--maengel { background: var(--err-soft); color: var(--err); }
@media (max-width: 560px) { .gewerk-row { grid-template-columns: 1fr auto; } .gewerk-num { display: none; } }
.add-gewerk summary, details.card summary { cursor: pointer; font-weight: 700; display: flex; gap: .5em; align-items: center; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary { margin-bottom: 14px; }
details.card form > label { margin-bottom: 12px; }

.gewerk-hero { background: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: end; border-top: 5px solid var(--line); margin-bottom: 18px; }
.gewerk-hero.status-in_arbeit { border-top-color: var(--info); }
.gewerk-hero.status-erledigt { border-top-color: var(--warn); }
.gewerk-hero.status-abgenommen { border-top-color: var(--ok); }
.gewerk-hero.status-maengel { border-top-color: var(--err); }
.gewerk-hero h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 10px 0 4px; }
.gewerk-hero p { margin: 0; }
.gewerk-progress { display: flex; align-items: center; gap: 12px; }
.gewerk-progress .bar { flex: 1; }
.gewerk-progress strong { font-size: 1.4rem; }
.gewerk-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.gewerk-col-side { position: sticky; top: 80px; }
@media (max-width: 960px) { .gewerk-layout { grid-template-columns: 1fr; } .gewerk-col-side { position: static; order: -1; } .gewerk-hero { grid-template-columns: 1fr; } }

.status-buttons { display: grid; gap: 8px; margin: 12px 0; }
.status-opt { flex-direction: row; }
.status-opt input { position: absolute; opacity: 0; }
.status-opt span { flex: 1; padding: .8em 1em; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; font-weight: 600; cursor: pointer; transition: .15s; }
.status-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.status-opt input:focus-visible + span { outline: 3px solid var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
label output { font-weight: 800; color: var(--accent-dark); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }

/* ---------- Callout ---------- */
.callout { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--info-soft); color: #1d4a95; margin-bottom: 16px; font-weight: 500; }
.callout--warn { background: var(--warn-soft); color: #6d4f00; }

/* ---------- Entry form ---------- */
.entry-form textarea { margin-bottom: 12px; }
.entry-form .form-grid { margin-bottom: 12px; grid-template-columns: repeat(4, 1fr); }
.entry-form label.full { margin-bottom: 12px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; flex-direction: row; font-weight: 600; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.file-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.korrektur-hint { background: var(--warn-soft); color: #6d4f00; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .9rem; }
.is-highlight { animation: hl 1.4s ease; }
@keyframes hl { 0% { box-shadow: 0 0 0 4px var(--accent); } }
@media (max-width: 760px) { .entry-form .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
	.form-actions .btn { flex: 1; }
}

/* ---------- Timeline ---------- */
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.timeline { position: relative; }
.timeline-day { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 22px 0 10px; font-weight: 700; }
.entry-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; margin-bottom: 12px; }
.entry-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.entry-item--bauherr .entry-avatar { background: var(--accent); }
.entry-body { background: #fff; border-radius: 4px 16px 16px 16px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(15,27,45,.06); min-width: 0; }
.entry-item--bauherr .entry-body { background: #fffaf5; border: 1px solid var(--accent-soft); }
.entry-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .88rem; margin-bottom: 6px; }
.entry-gewerk { font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.entry-time { margin-left: auto; color: var(--ink-soft); font-size: .8rem; }
.entry-text { white-space: normal; overflow-wrap: anywhere; }
.entry-ref { font-size: .85rem; background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; color: #6d4f00; }
.entry-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.entry-facts span { background: var(--paper); border-radius: 10px; padding: 6px 10px; font-size: .88rem; font-weight: 600; }
.entry-facts small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 500; }
.entry-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 10px; }
.entry-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.entry-file { display: inline-flex; gap: .4em; align-items: center; margin-top: 8px; padding: 6px 10px; background: var(--paper); border-radius: 8px; font-size: .88rem; text-decoration: none; }
.entry-seal { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .74rem; color: var(--ink-soft); font-family: var(--mono); word-break: break-all; }
.entry-seal .blb-icon { color: var(--ok); }
@media (max-width: 560px) { .entry-item { grid-template-columns: 1fr; } .entry-avatar { display: none; } .entry-time { margin-left: 0; width: 100%; } }

/* ---------- Dokumente ---------- */
.doc-group h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.doc-list { display: grid; gap: 8px; }
.doc-item { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(15,27,45,.05); }
.doc-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.doc-main { display: flex; flex-direction: column; min-width: 0; }
.doc-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .doc-item { grid-template-columns: 40px 1fr auto; } .doc-item .btn--ghost { display: none; } .doc-icon { width: 40px; height: 40px; } }

/* ---------- Abnahme ---------- */
.abnahme-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.astep { background: #fff; border-radius: 14px; padding: 14px; font-weight: 600; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; position: relative; }
.astep span { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-weight: 800; margin-bottom: 4px; }
.astep small { color: var(--ink-soft); font-weight: 400; }
.astep.is-done span { background: var(--ok); color: #fff; }
@media (max-width: 700px) { .abnahme-steps { grid-template-columns: 1fr 1fr; } }
.success-card { text-align: center; padding: 36px 24px; border-top: 5px solid var(--ok); }
.success-card > .blb-icon { width: 60px; height: 60px; padding: 14px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin: 0 auto 12px; display: block; }
.protokoll h3 { font-size: .95rem; margin: 18px 0 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.sig-img { margin: 18px 0 0; max-width: 300px; }
.sig-img img { border-bottom: 1px solid var(--ink); }
.sig-img figcaption { font-size: .8rem; color: var(--ink-soft); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice { flex-direction: row; position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { flex: 1; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; font-weight: 400; transition: .15s; }
.choice span strong { display: block; font-size: .95rem; }
.choice span small { color: var(--ink-soft); }
.choice input:checked + span { border-color: var(--ok); background: var(--ok-soft); }
.choice--err input:checked + span { border-color: var(--err); background: var(--err-soft); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); }
@media (max-width: 560px) { .choice-row { grid-template-columns: 1fr; } }
.accept-card { border: 2px solid var(--warn); }
.accept-card textarea, .accept-card .file-btn, .accept-card .check { margin-bottom: 12px; }
form.card > label.full, form.card > label.check, form.card > .sig-field { margin-bottom: 14px; }
.sig-field { display: flex; flex-direction: column; gap: 6px; }
.sig-label { font-weight: 600; font-size: .88rem; }
.sig-field canvas { width: 100%; max-width: 600px; height: 160px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-field .link-btn { align-self: flex-start; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,14,24,.94); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; margin: auto; }
.lightbox figcaption { color: #c9d3e0; margin-top: 10px; font-size: .9rem; }
.lightbox-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.8rem; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 2rem; border-radius: 12px; cursor: pointer; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.app-footer { text-align: center; font-size: .82rem; color: var(--ink-soft); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); }
.app-footer a { color: var(--ink-soft); }
.login-legal { text-align: center; font-size: .8rem; margin: 18px 0 0; color: var(--ink-soft); }
.login-legal a { color: var(--ink-soft); }

/* ==========================================================================
   Dashboards
   ========================================================================== */
.dash .page-head { align-items: center; }
.dash-sub { margin: 6px 0 0; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-report { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-report select { width: auto; min-width: 200px; border-radius: 999px; min-height: 44px; padding: .55em 1em; }
.card-title { font-size: 1.02rem; display: flex; align-items: center; gap: .5em; margin: 0 0 14px; }
.card-title .blb-icon { color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.dash-side { display: flex; flex-direction: column; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } .quick-report { flex: 1; } .quick-report select { flex: 1; min-width: 0; } }

/* KPI-Kacheln */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi-foot { font-size: .78rem; display: flex; align-items: center; gap: .3em; }
.kpi-foot .blb-icon { width: 1em; height: 1em; }
.kpi--alert { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--err); }
.kpi--alert .kpi-foot { color: var(--err); font-weight: 600; }
.t-up { color: var(--ok); font-weight: 600; }
.t-down { color: var(--ink-soft); font-weight: 600; }
@media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; } .kpi { padding: 12px 14px; } .kpi-value { font-size: 1.6rem; } }

/* Meter: Spur = hellere Stufe derselben Farbe */
.meter { display: block; height: 8px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.kpi .meter { margin-top: 6px; }

/* Handlungsbedarf */
.todo-group { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 18px 0 8px; font-weight: 700; }
.todo-group:first-of-type { margin-top: 0; }
.todo-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); text-decoration: none; margin-bottom: 6px; border-left: 4px solid var(--info); transition: transform .12s; }
.todo-item:hover { transform: translateX(2px); }
.todo-item small { display: block; color: var(--ink-soft); font-size: .82rem; margin-top: 2px; }
.todo-item > .blb-icon { color: var(--ink-soft); flex: none; }
.todo-item--err { border-left-color: var(--err); background: var(--err-soft); }
.todo-item--warn { border-left-color: var(--warn); background: var(--warn-soft); }
.todo-item--bauherr { border-left-color: var(--accent); background: #fffaf5; }
.todo-empty { display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.todo-empty > .blb-icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex: none; }
.todo-empty p { margin: 0; }

/* Aktivität (ein Datensatz, Balken mit Tooltip) */
.activity { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 120px; align-items: end; border-bottom: 1px solid var(--line); }
.activity-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.activity-col::before { content: ""; position: absolute; inset: 0 -2px; border-radius: 6px; }
.activity-col:hover::before, .activity-col:focus-visible::before { background: rgba(15,27,45,.05); }
.activity-bar { position: relative; width: 70%; max-width: 22px; background: #f6b78d; border-radius: 4px 4px 0 0; }
.activity-col.is-today .activity-bar { background: var(--accent); }
.activity-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .74rem; padding: 6px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; text-align: center; }
.activity-tip b { display: block; font-weight: 600; }
.activity-col:hover .activity-tip, .activity-col:focus-visible .activity-tip { opacity: 1; }
.activity-col:first-child .activity-tip { left: 0; transform: none; }
.activity-col:last-child .activity-tip { left: auto; right: 0; transform: none; }
.activity-axis { display: flex; justify-content: space-between; font-size: .74rem; color: var(--ink-soft); margin-top: 6px; }
.table-view { margin-top: 10px; font-size: .82rem; }
.table-view summary { cursor: pointer; color: var(--ink-soft); }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.table-view td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.table-view td:last-child { text-align: right; }

/* Demnächst */
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upcoming a { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 6px; border-radius: 10px; }
.upcoming a:hover { background: var(--paper); }
.upcoming small, .ptable small { display: block; color: var(--ink-soft); font-size: .8rem; }
.date-chip { width: 46px; height: 50px; border-radius: 10px; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; flex: none; }
.date-chip b { font-size: 1.15rem; line-height: 1; letter-spacing: 0; }

/* Baustellen-Tabelle */
.ptable { display: grid; }
.ptable-row { display: grid; grid-template-columns: 1.6fr 1.2fr 1.2fr .7fr; gap: 16px; align-items: center; padding: 14px 10px; border-top: 1px solid var(--line); text-decoration: none; border-radius: 10px; }
a.ptable-row:hover { background: var(--paper); }
.ptable-head { border-top: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding-top: 0; font-weight: 700; }
.ptable-name .badge { margin-top: 6px; }
.ptable-prog { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.ptable-prog small { grid-column: 1 / -1; }
.ptable-prog b { font-variant-numeric: tabular-nums; }
.ptable-cur { font-size: .9rem; }
.ptable-last { font-size: .85rem; text-align: right; }
@media (max-width: 760px) {
	.ptable-head { display: none; }
	.ptable-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
	.ptable-prog { grid-column: 1 / -1; grid-row: 2; }
	.ptable-cur { display: none; }
}

/* Feed */
.feed { display: grid; gap: 2px; margin-bottom: 12px; }
.feed-item { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 10px 8px; border-radius: 10px; text-decoration: none; position: relative; }
.feed-item:hover { background: var(--paper); }
.feed-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); margin-top: 6px; box-shadow: 0 0 0 3px #fff; }
.feed-item--ok .feed-dot { background: var(--ok); }
.feed-item--err .feed-dot { background: var(--err); }
.feed-item--warn .feed-dot { background: var(--warn); }
.feed-item--info .feed-dot { background: var(--info); }
.feed-main { display: flex; flex-direction: column; min-width: 0; }
.feed-title { font-size: .92rem; }
.feed-text { font-size: .88rem; color: #33445c; overflow-wrap: anywhere; }
.feed-meta { font-size: .76rem; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Bauherr ---------- */
.project-switch { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.bh-hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(24px, 4vw, 40px); display: grid; grid-template-columns: 1fr auto; gap: 24px 32px; margin-bottom: 22px; }
.bh-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(ellipse at 80% 30%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 80% 30%, #000 20%, transparent 70%); pointer-events: none; }
.bh-hero > * { position: relative; }
.bh-hero h1 { color: #fff; font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin: 0 0 10px; }
.bh-hero-lead { font-size: 1.1rem; color: #d5deea; margin: 0 0 14px; max-width: 34em; }
.bh-hero-lead strong { color: #fff; }
.bh-hero-facts { display: flex; flex-direction: column; gap: 6px; color: #b9c4d3; font-size: .92rem; }
.bh-hero-facts span { display: flex; gap: .5em; align-items: center; }
.bh-hero-facts .blb-icon { color: #ffb27d; }
.bh-hero-figure { display: flex; align-items: center; }
.ring--hero { --size: 168px; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring--hero span { background: var(--ink-2); color: #fff; font-size: 3rem; font-weight: 700; letter-spacing: -.03em; }
.ring--hero small { display: block; font-size: .78rem; font-weight: 500; color: #9fb0c6; letter-spacing: 0; margin-top: 2px; }
.phase-track { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line-dark); display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.phase-step { display: flex; flex-direction: column; gap: 6px; }
.phase-bar { display: block; height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; }
.phase-bar span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.phase-step.is-done .phase-bar span { background: #3fbf86; }
.phase-label { font-weight: 600; font-size: .9rem; }
.phase-val { font-size: .8rem; color: #9fb0c6; }
.phase-step.is-done .phase-val::before { content: "✓ "; color: #7fe0b2; }
@media (max-width: 700px) {
	.bh-hero { grid-template-columns: 1fr; }
	.bh-hero-figure { order: -1; }
	.ring--hero { --size: 128px; }
	.ring--hero span { font-size: 2.4rem; }
	.phase-track { grid-template-columns: 1fr 1fr; gap: 14px; }
}
.bh-tasks { margin-bottom: 22px; }
.bh-tasks .section-title { display: flex; align-items: center; gap: .5em; margin-top: 0; }
.bh-tasks .section-title .blb-icon { color: var(--accent); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.task-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); text-decoration: none; border: 2px solid var(--warn-soft); transition: transform .15s; }
.task-card:hover { transform: translateY(-2px); }
.task-card > .blb-icon { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); flex: none; }
.task-card > span:nth-of-type(1) { flex: 1; min-width: 0; }
.task-card small { display: block; color: var(--ink-soft); font-size: .82rem; }
.task-card .btn { flex: none; }
.task-card--primary { border-color: var(--accent); }
.task-card--primary > .blb-icon { background: var(--accent-soft); color: var(--accent-dark); }
.work-item { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.work-item:last-of-type { border-bottom: 0; }
.work-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.next-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: .92rem; }
.next-list a { text-decoration: none; font-weight: 600; }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-strip a { position: relative; display: block; border-radius: 12px; overflow: hidden; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .3s; }
.photo-strip a:hover img { transform: scale(1.04); }
.photo-strip span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .72rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .photo-strip { grid-template-columns: repeat(2, 1fr); } }
.mini-doc { display: flex; gap: 12px; align-items: center; padding: 8px 0; text-decoration: none; }
.mini-doc .doc-icon { width: 40px; height: 40px; flex: none; }
.mini-doc small { display: block; color: var(--ink-soft); font-size: .8rem; }
.link-more { display: inline-block; margin-top: 8px; font-weight: 600; font-size: .9rem; color: var(--accent-dark); text-decoration: none; }
.contact { display: flex; gap: 12px; align-items: center; }
.contact > span:nth-child(2) { flex: 1; }
.contact small { display: block; color: var(--ink-soft); font-size: .8rem; }
.app-icon-btn--light { background: var(--paper); color: var(--ink); }
.bh-open { margin: 6px 0 10px; }
