/* CD-Dashboard – Farben angelehnt an cd-systemtechnik.de */
:root {
  --navy: #0B2545;
  --navy-2: #13315C;
  --navy-3: #1D4E89;
  --accent: #3BB8EA;
  --accent-soft: #E7F6FD;
  --yellow: #FDB913;
  --yellow-hover: #F2AA00;
  --yellow-soft: #FFF6DC;

  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --text: #14243A;
  --muted: #5E6E82;
  --border: #E1E7EF;
  --border-strong: #C9D3DF;

  --danger: #B42318;
  --danger-soft: #FDECEA;
  --success: #17804F;
  --success-soft: #E6F6EE;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 37, 69, .05), 0 6px 20px rgba(11, 37, 69, .07);
  --shadow-hover: 0 2px 4px rgba(11, 37, 69, .07), 0 16px 36px rgba(11, 37, 69, .13);
  --focus: 0 0 0 3px rgba(59, 184, 234, .45);

  /* Systemschriften – keine externen Font-Server (DSGVO) */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* Erst anzeigen, wenn Übersetzungen geladen sind (kein Aufblitzen leerer Texte) */
body:not(.ready) { visibility: hidden; }
[hidden] { display: none !important; }

h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .35em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--navy-3); }
code { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-3) 45%, var(--accent) 100%);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-app {
  color: var(--navy); font-weight: 650; font-size: .95rem;
  padding-left: 14px; border-left: 1px solid var(--border-strong);
}
.topbar-nav { display: flex; align-items: center; gap: 14px; }
.nav-link {
  color: var(--navy); font-weight: 600; text-decoration: none; font-size: .92rem;
  padding: 6px 10px; border-radius: 8px;
}
.nav-link:hover, .nav-link.active { background: var(--accent-soft); }
.user-box { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-weight: 600; color: var(--navy); font-size: .92rem; }
.user-role { color: var(--muted); font-size: .78rem; }

.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
}
.lang-switch button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); padding: 4px 10px; border-radius: 999px;
}
.lang-switch button.active { background: var(--navy); color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 64px; }
.container-narrow { max-width: 560px; }
.page-head { margin-bottom: 28px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.back-link:hover { color: var(--navy); }
.icon-inline { display: inline-flex; width: 18px; height: 18px; }
.icon-inline svg { width: 100%; height: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.card-toolbar h2 { margin: 0; }
.card-toolbar p { margin: 2px 0 0; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 650; font-size: .95rem;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--yellow); color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--yellow-hover); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); border-color: var(--navy-3); }
.btn-small { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--navy); }
.field input, .select {
  font: inherit; font-weight: 400; color: var(--text);
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%;
}
.select { width: auto; padding: 9px 12px; }
.field .select { width: 100%; }
.field input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field input[readonly] { background: var(--bg); color: var(--muted); }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset legend { padding: 0; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-weight: 500; font-size: .92rem; color: var(--text);
}
.checks .check { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.checks .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checks .check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); margin: 0; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; margin-bottom: 0; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #F6C9C4; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #BDE5D1; }
.alert-info { background: var(--accent-soft); color: var(--navy-2); border-color: #BEE6F7; margin-bottom: 24px; }
.alert-warn { background: var(--yellow-soft); color: #7A5600; border-color: #F8E2A0; margin-bottom: 8px; }
main > .alert-error { margin-bottom: 24px; }

/* ---------- Login ---------- */
.page-login {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(59, 184, 234, .35), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(253, 185, 19, .16), transparent 60%),
    var(--navy);
}
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border-radius: 22px; padding: 32px 36px 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.login-logo { height: 44px; width: auto; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .form { margin-top: 22px; }
.login-card .btn { margin-top: 4px; }
.login-foot { color: rgba(255, 255, 255, .6); font-size: .82rem; margin-top: 22px; text-align: center; }

/* ---------- Bereichs-Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; }
.tile {
  --tile-color: var(--navy);
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-height: 250px; padding: 28px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--tile-color); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.tile:focus-visible { border-radius: 20px; }
.tile-firma { --tile-color: var(--yellow); }
.tile-praxis { --tile-color: var(--accent); }
.tile-immobilien { --tile-color: var(--navy); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 36px; }
.tile-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--navy);
}
.tile-firma .tile-icon { background: var(--yellow-soft); }
.tile-immobilien .tile-icon { background: #E8EDF5; }
.tile-icon svg { width: 34px; height: 34px; }
.tile-title { font-size: 1.45rem; font-weight: 700; color: var(--navy); }
.tile-desc { color: var(--muted); padding-right: 48px; }
.tile-arrow {
  position: absolute; right: 24px; bottom: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); color: var(--navy);
  transition: background .18s, color .18s, transform .18s;
}
.tile-arrow svg { width: 20px; height: 20px; }
.tile:hover .tile-arrow { background: var(--yellow); transform: translateX(3px); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge-lock { background: var(--accent-soft); color: var(--navy-2); }
.badge-icon { display: inline-flex; width: 13px; height: 13px; }
.badge-icon svg { width: 100%; height: 100%; }
.badge-small { font-size: .7rem; padding: 2px 8px; }

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}

/* ---------- Bereichs-Startseite ---------- */
.area-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.area-hero h1 { margin: 0; }
.area-hero p { margin: 2px 0 0; }
.area-hero-icon {
  flex: none; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--navy);
}
.area-firma .area-hero-icon { background: var(--yellow-soft); }
.area-immobilien .area-hero-icon { background: #E8EDF5; }
.area-hero-icon svg { width: 38px; height: 38px; }
.placeholder {
  background: var(--surface); border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 36px; text-align: center;
}
.placeholder h3 { margin-top: 28px; text-align: left; color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.module-grid {
  list-style: none; margin: 0; padding: 0; text-align: left;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px;
}
.module-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
.module-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.module-icon svg { width: 20px; height: 20px; }
.module-text { display: flex; flex-direction: column; font-size: .9rem; }
.module-text strong { color: var(--navy); }

/* ---------- Admin ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tab {
  font: inherit; font-weight: 650; font-size: .9rem; color: var(--muted);
  border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer;
}
.tab.active { background: var(--navy); color: #fff; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 14px 24px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFCFE; }
.table-compact td { padding: 9px 24px; font-size: .86rem; }
.th-actions { text-align: right; }
.cell-main { font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.cell-sub { color: var(--muted); font-size: .82rem; }
.cell-chips { display: table-cell; }
.cell-chips .chip + .chip { margin-left: 4px; }
.cell-date, .cell-ip { white-space: nowrap; color: var(--muted); }
.cell-details { font-family: var(--mono); font-size: .76rem; color: var(--muted); max-width: 380px; word-break: break-word; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn + .btn { margin-left: 6px; }
.is-inactive td { opacity: .55; }
.is-warning td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.me-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #E8EDF5; color: var(--navy); }
.chip-firma { background: var(--yellow-soft); color: #6E4E00; }
.chip-praxis { background: var(--accent-soft); color: var(--navy-2); }
.chip-all { background: var(--navy); color: #fff; }
.role { font-weight: 600; font-size: .88rem; }
.role-admin { color: var(--navy); }
.role-mitarbeiter { color: var(--navy-3); }
.role-partner { color: #6B5BB5; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-on { color: var(--success); }
.status-on::before { background: var(--success); }
.status-off { color: var(--muted); }
.status-off::before { background: var(--border-strong); }

.dialog {
  border: 0; border-radius: 20px; padding: 28px; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 30px 80px rgba(11, 37, 69, .35); color: var(--text);
}
.dialog::backdrop { background: rgba(11, 37, 69, .55); }
.dialog h2 { margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Benachrichtigungen (Glocke) */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--navy); cursor: pointer;
}
.notif-bell svg { width: 20px; height: 20px; }
.notif-bell:hover { background: var(--accent-soft); }
.notif-bell:focus-visible { outline: none; box-shadow: var(--focus); }
.notif-bell.has-unread svg { animation: notif-ring 1.2s ease-in-out 1; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--yellow); color: var(--navy); font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--navy); }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover, .notif-item:focus-visible { background: var(--accent-soft); outline: none; }
.notif-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 999px; background: transparent; }
.notif-item.is-unread .notif-dot { background: var(--accent); }
.notif-item.is-unread .notif-title { font-weight: 700; }
.notif-hero.is-unread .notif-dot { background: var(--danger); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { color: var(--navy); font-size: .9rem; }
.notif-sub { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--muted); font-size: .74rem; }
.notif-empty { padding: 22px 14px; text-align: center; margin: 0; }
.notif-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; gap: 12px; align-items: flex-start;
  width: min(360px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius-sm); text-decoration: none;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-hover); animation: notif-in .25s ease-out; transition: opacity .5s, transform .5s;
}
.notif-toast .notif-title { color: #fff; font-weight: 700; }
.notif-toast .notif-sub { color: rgba(255, 255, 255, .75); white-space: normal; }
.notif-toast-icon { flex: none; width: 22px; height: 22px; color: var(--yellow); }
.notif-toast-icon svg { width: 100%; height: 100%; }
.notif-toast.is-hiding { opacity: 0; transform: translateY(8px); }
.notif-toast + .notif-toast { bottom: 100px; }
@keyframes notif-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes notif-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .notif-bell.has-unread svg, .notif-toast { animation: none; } }

/* PDF-Anzeiger */
.pdf-dialog { width: min(1100px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.pdf-dialog:not([open]) { display: none; }
.pdf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pdf-title { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.pdf-pageinfo, .pdf-zoom { font-size: .85rem; font-variant-numeric: tabular-nums; }
.pdf-zoom { min-width: 48px; text-align: center; }
.pdf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.pdf-pages { flex: 1; overflow: auto; background: #E6EAF0; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pdf-page { background: #fff; box-shadow: 0 2px 10px rgba(11, 37, 69, .18); max-width: none; }
.pdf-status { margin: 40px auto; }
@media (max-width: 640px) {
  .pdf-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .pdf-title { max-width: 100%; }
}
.temp-pw {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
}
.temp-pw code { font-size: 1.15rem; font-weight: 700; color: var(--navy); letter-spacing: .04em; user-select: all; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow-hover);
}

/* ---------- Module (Bereichsseite) ---------- */
a.module-card { text-decoration: none; color: inherit; background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.module-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
a.module-card .module-icon { background: var(--yellow); color: var(--navy); }
.module-card.is-soon { opacity: .7; }
.module-state { margin-top: 6px; font-size: .75rem; font-weight: 700; }
.module-state-open { color: var(--navy-3); }
.module-state-soon { color: var(--muted); }
.modules-section { margin-top: 8px; }
.modules-section h2 { margin-bottom: 14px; }

/* ---------- Allgemeine Ergänzungen (Module) ---------- */
.container-wide { max-width: 1360px; }
.card + .card { margin-top: 24px; }
.toolbar-wrap { flex-wrap: wrap; }
.field textarea {
  font: inherit; font-weight: 400; color: var(--text); resize: vertical;
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); width: 100%;
}
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field input:disabled { background: var(--bg); color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.check-block { align-items: flex-start; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-sm); }
.check-block > span { display: flex; flex-direction: column; gap: 2px; }
.check-block input { margin-top: 2px; }
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.mr-auto { margin-right: auto; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #F0C2BD; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.input-search {
  font: inherit; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  min-width: 240px; background: var(--surface);
}
.input-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--navy); padding: 0; border: 0; }
.range-out { min-width: 48px; text-align: right; font-weight: 700; color: var(--navy); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; }
.segmented button {
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 650;
  color: var(--muted); padding: 5px 12px; border-radius: 999px;
}
.segmented button.active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(11, 37, 69, .15); }

.table tbody tr.is-clickable { cursor: pointer; }
.cell-link { text-decoration: none; }
.cell-link:hover { text-decoration: underline; }
.cell-nowrap { white-space: nowrap; }
.cell-num { font-variant-numeric: tabular-nums; }
.cell-progress { min-width: 140px; }
.table-empty { text-align: center; padding: 32px !important; }
.pnumber {
  font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--navy-3);
  background: #E8EDF5; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}

.pstatus { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pstatus-anfrage { background: #EEF1F5; color: var(--muted); }
.pstatus-geplant { background: var(--accent-soft); color: var(--navy-2); }
.pstatus-in_arbeit { background: var(--yellow-soft); color: #6E4E00; }
.pstatus-abgeschlossen { background: var(--success-soft); color: var(--success); }
.pstatus-storniert { background: #F4F4F4; color: #8A94A0; text-decoration: line-through; }

.pbar-wrap { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.pbar { flex: 1; height: 8px; min-width: 60px; background: #E8EDF5; border-radius: 999px; overflow: hidden; }
.pbar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--navy-3)); border-radius: 999px; }
.pbar-num { font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-accent { background: var(--navy); border-color: var(--navy); }
.stat-accent .stat-value { color: var(--yellow); }
.stat-accent .stat-label { color: rgba(255, 255, 255, .75); }

.project-head { margin-bottom: 24px; }
.project-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.project-head h1 { margin: 8px 0 2px; }
.project-head p { margin: 0; }
.project-meta { display: flex; gap: 10px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.fact { display: flex; flex-direction: column; gap: 4px; }
.fact-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact-value { font-weight: 600; color: var(--navy); }
.notes { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.notes-text { white-space: pre-wrap; margin: 4px 0 0; }

/* ---------- Responsiv ---------- */
@media (max-width: 720px) {
  .user-box, .brand-app { display: none; }
  .topbar-nav { gap: 8px; }
  .brand-logo { height: 34px; }
  .container { padding-top: 24px; }
  .tile { min-height: 200px; }
  .login-card { padding: 26px 22px 28px; }
  .placeholder { padding: 24px 18px; }
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
  .stats { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .input-search { min-width: 0; width: 100%; }
  .card-toolbar { padding: 16px 14px; }
}
