/* 33² Bau — Design-Tokens 1:1 aus dem 33² Desk übernommen. */
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/hankengrotesk.woff2') format('woff2'); }

:root {
  --brand: #c9a86b; --brand-600: #b99452; --brand-700: #8a6c3c;
  --brand-050: #f8f4ea; --brand-100: #ecdfc2;
  --ink: #11201f; --ink-2: #33514f; --muted: #6b7e7d; --muted-2: #8fa19f;
  --page: #eceef3; --surface: #ffffff; --surface-2: #f5f6f9;
  --border: #e6e8ef; --border-2: #eef0f5;
  --glass: rgba(255,255,255,0.55); --glass-strong: rgba(255,255,255,0.82);
  --glass-border: rgba(255,255,255,0.68);
  --content-grad: linear-gradient(146deg, #f8f8f6 0%, #f4f3ee 55%, #efece2 100%);
  --shadow-glass: 0 10px 34px rgba(96,92,70,0.09);
  --side-bg: #15171c; --side-bg-2: #1d2026; --side-ink: #c8cdd7; --side-muted: #79808f; --side-active: #d9bd85;
  --accent: #c9a86b; --accent-600: #b99452; --accent-700: #8a6c3c;
  --danger: #df4233; --danger-bg: #fdeceb; --success: #18996a; --success-bg: #e6f4ee; --warning: #c98a16;
  --shadow-sm: 0 1px 2px rgba(30,40,80,0.05); --shadow: 0 6px 20px rgba(30,40,80,0.06);
  --shadow-lg: 0 14px 40px rgba(30,40,80,0.12); --shadow-card: 0 18px 50px rgba(25,33,61,0.10);
  --radius: 16px; --radius-sm: 10px; --radius-lg: 24px;
  --font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--content-grad); min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font-family: var(--font); cursor: pointer; }
img { max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.hidden { display: none !important; }

/* ------------------------------ Bausteine ------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.pill svg { width: 12px; height: 12px; }
.pill.on { background: var(--success-bg); color: var(--success); border-color: transparent; }
.pill.off { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.pill.warn { background: #fdf3e0; color: var(--warning); border-color: transparent; }
.pill.brand { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-100); }
.btn { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #201704; }
.btn-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-block { display: flex; width: 100%; text-align: center; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.danger { color: var(--danger); }
.bold { font-weight: 800; }
.bronze { color: var(--brand-700); }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.input, textarea.input { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 15px; font-family: var(--font); background: #fff; color: var(--ink); }
.input:focus { outline: 2px solid var(--brand-100); border-color: var(--brand); }
textarea.input { resize: vertical; }
select.input { appearance: none; }
.fl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.note { background: var(--brand-050); border: 1px solid var(--brand-100); color: var(--ink-2); font-size: 13.5px; border-radius: var(--radius-sm); padding: 11px 14px; margin: 14px 0 0; line-height: 1.45; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--side-bg); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 90; max-width: 86vw; text-align: center; }
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Login ------------------------------ */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.login-aside { background: var(--side-bg); color: var(--side-ink); padding: 48px 52px; display: flex; flex-direction: column; gap: 18px; }
.la-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.la-brand svg { width: 38px; height: 42px; color: var(--side-active); }
.la-brand b { font-size: 24px; }
.la-brand b span { color: var(--side-active); }
.login-aside h1 { color: #fff; font-size: 34px; letter-spacing: -0.02em; line-height: 1.12; margin: 26px 0 0; text-wrap: balance; }
.login-aside p { font-size: 15.5px; line-height: 1.55; margin: 0; max-width: 46ch; }
.la-feats { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.la-feats li { display: flex; align-items: center; gap: 10px; }
.la-feats svg { width: 18px; height: 18px; color: var(--side-active); flex: none; }
.la-foot { margin-top: auto; font-size: 12px; color: var(--side-muted); padding-top: 30px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 34px 32px 26px; }
.login-card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.auth-error { background: var(--danger-bg); color: var(--danger); font-size: 13.5px; font-weight: 700; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.demo-acc { margin-top: 22px; border-top: 1px solid var(--border-2); padding-top: 14px; }
.demo-acc summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--brand-700); }
.demo-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 6px; }
.demo-row:hover { background: var(--surface-2); }
.demo-row > span:last-child b { display: block; font-size: 13.5px; }
.demo-row > span:last-child span { font-size: 12px; color: var(--muted); }
.demo-row .pill { min-width: 84px; justify-content: center; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-aside { padding: 28px 24px 24px; } .login-aside h1 { font-size: 26px; margin-top: 12px; } .la-feats, .la-foot { display: none; } .login-main { padding: 22px 16px 40px; align-items: flex-start; } .login-card { padding: 26px 22px 20px; } }

/* ------------------------------ Desk-Shell ------------------------------ */
.desk { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--side-bg); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; color: #fff; }
.sidebar .brand svg { width: 26px; height: 28px; color: var(--side-active); }
.sidebar .brand b { font-size: 17px; }
.nav-scroll { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; min-height: 0; }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 16px 12px 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--side-ink); font-size: 14px; font-weight: 500; border: 0; background: none; text-align: left; width: 100%; }
.nav-item svg { width: 18px; height: 18px; color: var(--side-muted); flex: none; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(244,220,52,0.08); color: var(--side-active); font-weight: 600; }
.nav-item.active svg { color: var(--side-active); }
.nav-count { margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #201704; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.sidebar .foot { margin-top: auto; font-size: 11.5px; color: var(--side-muted); padding: 12px 8px 0; }
.desk-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 30px; background: var(--glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 8; }
.mob-brand { display: none; align-items: center; gap: 9px; }
.mob-brand svg { width: 24px; height: 26px; color: var(--brand-700); }
.mob-brand b { font-size: 16px; }
.topbar .search { position: relative; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; flex: 1; max-width: 440px; }
.topbar .search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.topbar .search input { border: 0; outline: 0; background: none; font-family: var(--font); font-size: 14px; width: 100%; color: var(--ink); }
.search-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; overflow: hidden; z-index: 30; }
.search-drop.open { display: block; }
.sd-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; border-bottom: 1px solid var(--border-2); }
.sd-item:hover { background: var(--surface-2); }
.sd-item .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-050); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex: none; }
.sd-item .ic svg { width: 15px; height: 15px; }
.sd-item b { display: block; font-size: 13.5px; }
.sd-item span span { font-size: 12px; color: var(--muted); }
.sd-empty { padding: 14px; font-size: 13px; color: var(--muted); }
.icon-btn { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); }
.bell { margin-left: auto; }
.bell .nav-count { position: absolute; top: -6px; right: -6px; margin: 0; background: var(--danger); color: #fff; }
.userblock { display: flex; align-items: center; gap: 10px; }
.userblock .avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--side-bg); color: var(--side-active); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.userblock .um b { display: block; font-size: 13.5px; line-height: 1.15; }
.userblock .um span { font-size: 11.5px; color: var(--muted); }
.notif-panel { position: absolute; top: calc(100% + 4px); right: 30px; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; overflow: hidden; z-index: 40; }
.notif-panel.open { display: block; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.np-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 11px 16px; border-bottom: 1px solid var(--border-2); }
.np-item:hover { background: var(--surface-2); }
.np-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--border); flex: none; margin-top: 6px; }
.np-item.unread .np-dot { background: var(--brand); }
.np-tx { display: block; font-size: 13.5px; }
.np-item.unread .np-tx { font-weight: 700; }
.np-t { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.np-empty { padding: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.panel-link { background: none; border: 0; color: var(--brand-700); font-weight: 800; font-size: 13px; padding: 0; }
.desk-main { flex: 1; padding: 26px 30px 40px; max-width: 1200px; width: 100%; }
.desk-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.desk-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.view-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; float: right; }
.view-toolbar .btn { padding: 9px 14px; font-size: 13.5px; }
.back { background: none; border: 0; color: var(--brand-700); font-weight: 800; font-size: 14px; padding: 0 0 12px; display: inline-flex; gap: 6px; align-items: center; }
.back svg { width: 16px; height: 16px; }

/* Tab-Bar & „Mehr" (nur mobil) */
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--glass-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 50; }
.tab { flex: 1; background: none; border: 0; padding: 9px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--brand-700); }
.tab .b { position: relative; }
.tab .dot { position: absolute; top: -3px; right: -7px; min-width: 15px; height: 15px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9.5px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.more-sheet { display: none; position: fixed; inset: 0; background: rgba(17,20,26,0.45); z-index: 55; align-items: flex-end; }
.more-sheet.open { display: flex; }
.ms-card { width: 100%; max-height: 78vh; overflow-y: auto; background: var(--side-bg); border-radius: 22px 22px 0 0; padding: 12px 14px calc(70px + env(safe-area-inset-bottom)); }

/* Dashboard */
.qstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 18px 0; }
.qstat { display: flex; gap: 12px; align-items: center; padding: 16px; text-align: left; font-family: var(--font); color: var(--ink); }
button.qstat:hover { box-shadow: var(--shadow-lg); }
.qstat .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--brand-050); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex: none; }
.qstat .ic.bad { background: var(--danger-bg); color: var(--danger); }
.qstat .ic svg { width: 20px; height: 20px; }
.qstat .v { font-size: 21px; font-weight: 800; display: block; letter-spacing: -0.01em; }
.qstat .l { font-size: 12.5px; color: var(--muted); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.proj-tile { overflow: hidden; padding: 0; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); font-family: var(--font); color: var(--ink); transition: box-shadow .15s, transform .15s; }
.proj-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.proj-tile .im { height: 138px; background: var(--surface-2); position: relative; display: block; }
.proj-tile .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-tile .im .code { position: absolute; top: 10px; left: 10px; background: rgba(21,23,28,0.82); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.proj-tile .im .tile-status { position: absolute; top: 10px; right: 10px; }
.proj-tile .tx { padding: 12px 14px 14px; display: block; }
.proj-tile .tx b { display: block; font-size: 15px; }
.proj-tile .tx span { font-size: 12.5px; color: var(--muted); display: block; }
.prog { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.cols2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.feed { padding: 6px 16px; }
.feed .fi { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; align-items: center; }
.feed .fi:last-child { border-bottom: 0; }
.feed .fi .t { color: var(--muted); flex: none; width: 88px; font-size: 12px; }
.feed .fi b { display: block; font-size: 13px; }
.feed .fi span { color: var(--muted); font-size: 12.5px; }
.fi-btn { background: none; border: 0; width: 100%; text-align: left; font-family: var(--font); color: var(--ink); }
.fi-btn:hover { background: var(--surface-2); }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); font-family: var(--font); color: var(--ink); }
.list-item .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink-2); }
.list-item .ic.warn { background: var(--danger-bg); color: var(--danger); }
.list-item .ic.ok { background: var(--success-bg); color: var(--success); }
.list-item .ic svg { width: 19px; height: 19px; }
.list-item .tx { flex: 1; min-width: 0; }
.list-item .tx b { display: block; font-size: 14.5px; }
.list-item .tx span { font-size: 12.5px; color: var(--muted); }

/* Termine */
.appt { padding: 14px; margin-bottom: 12px; }
.appt .row1 { display: flex; align-items: center; gap: 10px; }
.appt .when { background: var(--side-bg); color: #fff; border-radius: 12px; padding: 8px 10px; text-align: center; flex: none; min-width: 58px; }
.appt .when .d { font-size: 16px; font-weight: 800; display: block; }
.appt .when .t { font-size: 11px; color: var(--side-active); }
.appt .tt b { display: block; font-size: 15px; }
.appt .tt span { font-size: 12.5px; color: var(--muted); display: block; }
.appt .ci { display: flex; gap: 8px; margin-top: 12px; }
.appt .ci .btn { flex: 1; padding: 11px 8px; font-size: 14px; }
.checked { font-size: 13px; font-weight: 700; color: var(--success); background: var(--success-bg); border-radius: 10px; padding: 9px 12px; margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.checked svg { width: 15px; height: 15px; }

/* Bauzeitenplan */
.gp { position: relative; margin: 0 0 10px; padding: 12px 14px 12px 18px; }
.gp::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 5px 0 0 5px; background: var(--border); }
.gp.done::before { background: var(--success); }
.gp.active::before { background: var(--brand); }
.gp.me { outline: 2px solid var(--brand); outline-offset: -1px; }
.gp .r1 { display: flex; align-items: center; gap: 8px; }
.gp .r1 b { font-size: 14.5px; flex: 1; }
.gp .r2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dep { font-size: 12px; color: var(--warning); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; }
.dep svg { width: 13px; height: 13px; }
.gantt-card { position: relative; padding: 14px 18px; margin-top: 14px; }
.g-row { display: grid; grid-template-columns: 220px 1fr 210px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-2); }
.g-row:last-child { border-bottom: 0; }
.g-row.mine { background: var(--brand-050); margin: 0 -18px; padding: 9px 18px; }
.g-info b { display: block; font-size: 13.5px; line-height: 1.25; }
.g-info span { font-size: 12px; color: var(--muted); }
.g-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 99px; }
.g-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 99px; background: var(--border); overflow: hidden; }
.g-bar.done { background: var(--success); opacity: .75; }
.g-bar.active { background: var(--brand-100); }
.g-bar.active i { display: block; height: 100%; background: var(--brand); }
.g-bar.planned { background: var(--brand-050); border: 1px solid var(--brand); }
.g-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); justify-content: flex-end; white-space: nowrap; }
.g-actions { display: inline-flex; gap: 5px; }
.g-today { position: absolute; top: 12px; bottom: 12px; width: 2px; background: var(--danger); z-index: 2; opacity: .6; pointer-events: none; }
.g-today span { position: absolute; top: -12px; left: -16px; font-size: 10px; font-weight: 800; color: var(--danger); }
.range-row { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.range-row input { flex: 1; accent-color: var(--brand); }
.range-row b { min-width: 52px; text-align: right; font-size: 18px; }

/* Bautagebuch */
.diary { padding: 14px 18px; margin-top: 12px; }
.diary .dh { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.diary p { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.diary .auto { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.diary .auto li { margin: 2px 0; }

/* Tabellen (Desk-Listen) */
.tbl { overflow-x: auto; margin-top: 14px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .rowbtn { cursor: pointer; }
.tbl .rowbtn:hover td { background: var(--surface-2); }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td.r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; margin: 14px 0 0; }
.filters.wrap { flex-wrap: wrap; }
.filters .pill { cursor: pointer; border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; font-size: 13px; }
.filters .pill.brand { border-color: var(--brand-100); }
table.calc { font-size: 13.5px; }
table.calc th, table.calc td { padding: 8px 10px; }
table.calc tfoot td { border-top: 1px solid var(--border); border-bottom: 0; color: var(--muted); }
table.calc tfoot tr.sum td { color: var(--ink); font-size: 15px; }
.calc-form { display: flex; gap: 6px; margin: 10px 0; align-items: center; }
.calc-form .input { padding: 9px 10px; font-size: 13.5px; min-width: 0; }
.aufm-pick { font-size: 13px; background: var(--brand-050); border-radius: 10px; padding: 10px 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.aufm-pick .input { padding: 6px 8px; font-size: 13px; }

/* Modal (Desk-Stil) */
.modal-overlay { position: fixed; inset: 0; background: rgba(17, 20, 26, 0.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-card); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; z-index: 2; }
.modal-head b { font-size: 16px; }
.modal-body { padding: 18px 20px 22px; }
.icon-x { background: none; border: 0; color: var(--muted); padding: 4px; border-radius: 8px; }
.icon-x svg { width: 18px; height: 18px; display: block; }
.icon-x:hover { background: var(--surface-2); color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; flex-direction: column; gap: 5px; }
.kv { display: flex; gap: 10px; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--border-2); }
.kv span { color: var(--muted); min-width: 110px; flex: none; }
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.kv-grid div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.kv-grid span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.kv-grid b { font-size: 14px; font-variant-numeric: tabular-nums; }
.photo-strip { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.ph { width: 74px; height: 74px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 10px; overflow: hidden; position: relative; }
.ph svg { width: 18px; height: 18px; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.proof { border: 2px solid var(--success); }
.ph.proof i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--success); color: #fff; font-style: normal; font-weight: 800; text-align: center; font-size: 9.5px; padding: 2px; }
.actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13.5px; margin: 10px 0; }
.chk-grid label { display: flex; align-items: center; gap: 7px; }
.chk-grid input { accent-color: var(--brand-700); }

/* Projekt-Detail */
.proj-hero { display: flex; gap: 22px; overflow: hidden; align-items: stretch; }
.proj-hero img { width: 42%; min-height: 220px; object-fit: cover; }
.proj-hero .ph-tx { padding: 22px 24px 22px 2px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.proj-hero h1 { margin: 4px 0 2px; font-size: 26px; letter-spacing: -0.02em; }
.plan-frame { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.plan-svg { display: block; width: 100%; height: auto; background: #fcfcfa; }
.watermark { font-size: 11.5px; color: var(--muted); text-align: center; padding: 9px; border-top: 1px dashed var(--border); }

/* Chat */
.chat { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 130px); min-height: 480px; }
.chat-list { overflow-y: auto; padding-right: 2px; }
.ch-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-family: var(--font); color: var(--ink); }
.ch-item.active { border-color: var(--brand); background: var(--brand-050); }
.ch-item .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.ch-item .ic svg { width: 17px; height: 17px; }
.ch-item .tx { flex: 1; min-width: 0; }
.ch-item .tx b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-item .tx span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-height: 0; }
.ct-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); font-size: 14.5px; }
.ct-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; background: linear-gradient(180deg, #f8f8f6, #f3f2ec); display: flex; flex-direction: column; gap: 6px; }
.ct-day { align-self: center; font-size: 11px; font-weight: 800; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin: 8px 0 4px; }
.ct-sys { align-self: center; font-size: 12px; color: var(--ink-2); background: var(--brand-050); border-radius: 10px; padding: 6px 12px; text-align: center; max-width: 80%; }
.msg { display: flex; }
.msg.own { justify-content: flex-end; }
.bubble { max-width: 72%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-sm); }
.msg.own .bubble { background: var(--brand-100); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bubble b { display: block; font-size: 12px; color: var(--brand-700); margin-bottom: 2px; }
.bubble span { white-space: pre-wrap; word-break: break-word; }
.bubble img { display: block; max-width: 260px; border-radius: 10px; margin: 4px 0; }
.bubble i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.ct-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border-2); background: var(--surface); }
.ct-input textarea { flex: 1; resize: none; max-height: 120px; padding: 10px 12px; }
.ct-input .btn { padding: 10px 14px; }
.ct-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.mob-only { display: none; }

/* ------------------------------ Mobil ------------------------------ */
@media (max-width: 860px) {
  .desk { display: block; }
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .mob-brand { display: flex; }
  .mob-only { display: inline-flex; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar .search { max-width: none; }
  .userblock .um { display: none; }
  .userblock .avatar { width: 34px; height: 34px; }
  .notif-panel { right: 12px; }
  .desk-main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .desk-head h1 { font-size: 21px; }
  .view-toolbar { float: none; justify-content: flex-start; margin: 0 0 10px; flex-wrap: wrap; }
  .cols2 { grid-template-columns: 1fr; }
  .g-row { grid-template-columns: 1fr; gap: 6px; }
  .g-row.mine { margin: 0 -14px; padding: 9px 14px; }
  .g-meta { justify-content: flex-start; white-space: normal; }
  .g-today { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label[style] { grid-column: auto !important; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .chk-grid { grid-template-columns: 1fr; }
  .proj-hero { flex-direction: column; }
  .proj-hero img { width: 100%; min-height: 170px; }
  .proj-hero .ph-tx { padding: 0 18px 18px; }
  .modal { max-height: 92vh; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .chat { display: block; height: auto; min-height: 0; }
  .chat .chat-thread { display: none; }
  .chat.has-thread .chat-list { display: none; }
  .chat.has-thread .chat-thread { display: flex; height: calc(100vh - 150px); min-height: 380px; }
  .bubble { max-width: 86%; }
  .calc-form { flex-wrap: wrap; }
  .calc-form .input { flex: 1 1 45% !important; }
}
@media (max-width: 560px) { .topbar .search { display: none; } .mob-brand { flex: 1; } }
