/* ===========================================================================
   WWDigitalwerk Kundenportal – Design System v2 (lädt nach styles.css)
   Reine Präsentation. Brandfarben aus styles.css (--navy/--action/...).
   =========================================================================== */

:root {
  --kp-sidebar-w: 250px;
  --kp-shadow-sm: 0 1px 2px rgba(22, 40, 64, 0.06), 0 8px 24px rgba(22, 40, 64, 0.06);
  --kp-shadow-md: 0 2px 4px rgba(22, 40, 64, 0.07), 0 18px 40px rgba(22, 40, 64, 0.1);
  --kp-r-sm: 8px;
  --kp-r-md: 12px;
  --kp-r-lg: 18px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --kp-ease: cubic-bezier(.2, .6, .2, 1); --kp-dur-fast: 140ms; --kp-dur: 220ms;
}

.ic {
  flex: 0 0 auto;
  vertical-align: -3px;
}

/* ---- Brand mark -------------------------------------------------------- */
.brand-mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 6px 16px rgba(11, 22, 40, 0.28);
}

/* ====================== ADMIN APP SHELL (Sidebar) ======================= */
body.shell-admin,
body.shell-client {
  display: grid;
  grid-template-columns: var(--kp-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.nav-scrim { display: none; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 0.75rem 0.9rem;
  background: linear-gradient(180deg, var(--navy), var(--navy-mid, #1d3350));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  z-index: 40;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.9rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.sb-brand-text { display: grid; line-height: 1.15; }
.sb-brand-text strong { font-weight: 700; font-size: 0.98rem; }
.sb-brand-text small { color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; font-weight: 600; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; padding-top: 0.7rem; flex: 1; }

.sb-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  border-radius: var(--kp-r-sm);
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 560;
  transition: background 0.15s ease, color 0.15s ease;
}
.sb-link:hover, .sb-link:focus-visible { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sb-link.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--action);
}
.sb-link .ic { color: rgba(255, 255, 255, 0.85); }
.sb-link.is-active .ic { color: #ff9d63; }

.badge-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--action);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sb-foot { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.7rem; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.sb-link-sub { color: rgba(255, 255, 255, 0.6); font-size: 0.88rem; }
.sb-account { display: flex; align-items: center; gap: 0.55rem; padding: 0.2rem 0.5rem; }
.sb-account-name { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout-form { margin: 0; }
.sb-logout {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.55rem 0.7rem; border-radius: var(--kp-r-sm);
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sb-logout:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); color: #fff; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.appbar { display: none; }

/* Content width + einheitlicher vertikaler Rhythmus */
.shell-admin .app-main .shell,
.shell-client .shell {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding: 1.75rem clamp(16px, 3vw, 36px) 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
/* Legacy-Sektionsabstände der direkten Kinder neutralisieren – Abstand kommt vom gap */
.shell-admin .app-main .shell > *,
.shell-client .shell > * { margin-top: 0 !important; margin-bottom: 0 !important; }

/* ====================== CLIENT / AUTH TOPBAR =========================== */
.topbar.client, .topbar.bare {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, var(--navy), var(--navy-mid, #1d3350));
  color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar .brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-weight: 700; }
.brand-text small { color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; font-weight: 600; }
.client-nav { display: flex; align-items: center; gap: 0.8rem; }
.client-nav .who { display: inline-flex; align-items: center; gap: 0.4rem; color: rgba(255, 255, 255, 0.82); font-size: 0.92rem; font-weight: 600; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.8rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06);
  color: #fff; font-weight: 600; font-size: 0.88rem; cursor: pointer; text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ====================== AVATARS ======================================== */
.avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 999px;
  background: hsl(var(--hue, 210), 42%, 46%); color: #fff;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 0.74rem; }

/* ====================== TOASTS ========================================= */
.toastwrap { position: fixed; top: 16px; right: 16px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 0.9rem; border-radius: var(--kp-r-md);
  background: var(--surface, #fffdf8); color: var(--text, #162840);
  box-shadow: var(--kp-shadow-md); border: 1px solid var(--line, rgba(22,40,64,.12));
  font-weight: 600; font-size: 0.92rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast-success { border-left: 3px solid var(--forest, #2d5a3d); }
.toast-success .ic { color: var(--forest, #2d5a3d); }
.toast-error { border-left: 3px solid #9f1d1d; }
.toast-error .ic { color: #9f1d1d; }
.toast-hide { opacity: 0; transform: translateY(-8px); }

/* ====================== COMPONENT POLISH =============================== */
/* Hero band: etwas ruhiger, abgerundet */
.hero-band { border-radius: var(--kp-r-lg); box-shadow: var(--kp-shadow-sm); }

/* Cards / panels */
.panel, .side-panel, .project-card, .stats > div, .timeline-body {
  border-radius: var(--kp-r-md);
  box-shadow: var(--kp-shadow-sm);
}

/* Stat cards */
.stats { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.stats > div { padding: 1.1rem 1.2rem; position: relative; }
.stats strong { font-size: 2.1rem; letter-spacing: -0.01em; }
.stats .stat-ic {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; background: var(--action-soft, rgba(184,74,22,.12)); color: var(--action);
}

/* Buttons */
.button { border-radius: 999px; box-shadow: 0 6px 16px rgba(184, 74, 22, 0.22); }
.button:hover { transform: translateY(-1px); }
.button-secondary { box-shadow: none; }
.button, .button-secondary, .button-danger { transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; border: 1px solid var(--line, rgba(22,40,64,.12));
  background: var(--surface, #fffdf8); color: var(--muted, #6b7060); cursor: pointer; text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { color: var(--action); border-color: rgba(184, 74, 22, 0.4); background: var(--action-soft, rgba(184,74,22,.1)); }
.icon-btn.danger:hover { color: #9f1d1d; border-color: rgba(159, 29, 29, 0.4); background: rgba(159, 29, 29, 0.08); }

/* Tables */
table { border-collapse: separate; border-spacing: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-muted, rgba(22,40,64,.02)); }
td .cell-main { display: flex; align-items: center; gap: 0.6rem; }
.row-actions { gap: 0.4rem; }

/* Status pills – ruhiger, klar */
.badge { padding: 0.28rem 0.62rem; font-weight: 700; }
.badge-team { background: rgba(22, 40, 64, 0.08); color: var(--navy, #162840); }

/* Empty states */
.empty-state { display: grid; justify-items: center; gap: 0.6rem; padding: 2.4rem 1rem; text-align: center; color: var(--muted, #6b7060); }
.empty-state .empty-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--action-soft, rgba(184,74,22,.1)); color: var(--action); }
.empty-state h3 { margin: 0; color: var(--text, #162840); }

/* Progress stepper */
.stepper { display: flex; align-items: center; gap: 0; margin: 0.4rem 0; }
.stepper-step { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; flex: 1; position: relative; }
.stepper-step::before {
  content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px;
  background: var(--line, rgba(22,40,64,.14)); z-index: 0;
}
.stepper-step:first-child::before { display: none; }
.stepper-dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; background: var(--bg-soft, #ede9e1); color: var(--muted, #6b7060);
  border: 2px solid var(--line, rgba(22,40,64,.14)); font-size: 0.8rem; font-weight: 700;
}
.stepper-label { font-size: 0.76rem; font-weight: 600; color: var(--muted, #6b7060); text-align: center; }
.stepper-step.done .stepper-dot { background: var(--forest, #2d5a3d); border-color: var(--forest, #2d5a3d); color: #fff; }
.stepper-step.done::before { background: var(--forest, #2d5a3d); }
.stepper-step.current .stepper-dot { background: var(--action); border-color: var(--action); color: #fff; box-shadow: 0 0 0 4px rgba(184, 74, 22, 0.16); }
.stepper-step.current .stepper-label { color: var(--text, #162840); }

/* Trust / support block (Kundenseite) */
.trust-card { display: grid; gap: 0.9rem; }
.trust-contact { display: flex; align-items: center; gap: 0.7rem; }
.trust-lines { display: grid; gap: 0.45rem; }
.trust-line { display: flex; align-items: center; gap: 0.5rem; color: var(--text, #162840); font-weight: 600; text-decoration: none; }
.trust-line .ic { color: var(--action); }
.trust-note { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.7rem 0.8rem; border-radius: var(--kp-r-sm); background: var(--forest-soft, rgba(45,90,61,.12)); color: var(--text, #162840); font-size: 0.86rem; line-height: 1.45; }
.trust-note .ic { color: var(--forest, #2d5a3d); margin-top: 1px; }
:root[data-theme="dark"] .trust-note { background: rgba(74, 160, 110, 0.16); color: var(--text, #e8eef7); }
:root[data-theme="dark"] .trust-note .ic { color: #6fcf97; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .trust-note { background: rgba(74, 160, 110, 0.16); color: var(--text, #e8eef7); } :root[data-theme="auto"] .trust-note .ic { color: #6fcf97; } }

/* Chat messages */
.chat { display: grid; gap: 0.6rem; }
.chat-msg { max-width: 80%; padding: 0.65rem 0.85rem; border-radius: 14px; box-shadow: var(--kp-shadow-sm); }
.chat-msg .chat-meta { display: block; font-size: 0.72rem; color: var(--muted, #6b7060); margin-bottom: 0.2rem; font-weight: 600; }
.chat-them { justify-self: start; background: var(--surface, #fffdf8); border: 1px solid var(--line, rgba(22,40,64,.12)); border-bottom-left-radius: 4px; }
.chat-me { justify-self: end; background: var(--navy, #162840); color: #fff; border-bottom-right-radius: 4px; }
.chat-me .chat-meta { color: rgba(255, 255, 255, 0.66); }

/* Footer */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-trust { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ====================== MOBILE ========================================= */
@media (max-width: 900px) {
  body.shell-admin, body.shell-client { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px;
    transform: translateX(-100%); transition: transform 0.24s ease; box-shadow: var(--kp-shadow-md);
  }
  .nav-cb:checked ~ .sidebar { transform: translateX(0); }
  .nav-cb:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(22, 40, 64, 0.45); z-index: 35; }
  .appbar {
    display: flex; align-items: center; gap: 0.7rem;
    position: sticky; top: 0; z-index: 20;
    padding: 0.6rem clamp(12px, 4vw, 20px);
    background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-burger { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
  .appbar-title { font-weight: 700; font-size: 1rem; }
  .chat-msg { max-width: 92%; }
  .support-strip { flex-direction: column; align-items: flex-start; }
}

/* ---- Client components (Pass 2) -------------------------------------- */
.button { gap: 0.45rem; }
.text-link { display: inline-flex; align-items: center; gap: 0.3rem; }
.meta-time { display: inline-flex; align-items: center; gap: 0.3rem; }
.project-card { display: grid; gap: 0.7rem; }
.project-card .stepper { margin: 0.1rem 0 0.2rem; }
.inline-badge {
  display: inline-flex; align-items: center; gap: 0.35rem; align-self: flex-start;
  padding: 0.25rem 0.62rem; border-radius: 999px;
  background: var(--action-soft, rgba(184, 74, 22, 0.12)); color: var(--action-hover, #96360d);
  font-size: 0.8rem; font-weight: 700;
}
.status-panel { padding: 1.1rem 1.4rem; }
.content-grid .stack, .stack { display: grid; gap: 1rem; align-content: start; }

.file-list { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.file-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line, rgba(22, 40, 64, 0.12)); border-radius: var(--kp-r-sm);
  text-decoration: none; color: var(--text, #162840);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-row:hover { border-color: rgba(184, 74, 22, 0.34); background: var(--surface-muted, rgba(22, 40, 64, 0.02)); }
.file-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--action-soft, rgba(184, 74, 22, 0.1)); color: var(--action); flex: 0 0 auto; }
.file-meta { display: grid; flex: 1; min-width: 0; }
.file-meta strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--muted, #6b7060); }
.file-dl { color: var(--muted, #6b7060); flex: 0 0 auto; }
.file-row:hover .file-dl { color: var(--action); }

.trust-person { display: grid; line-height: 1.3; }
.support-strip { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.support-text { display: grid; gap: 0.2rem; }
.support-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.support-links .trust-line { padding: 0.5rem 0.85rem; border: 1px solid var(--line, rgba(22, 40, 64, 0.12)); border-radius: 999px; }
.support-links .trust-line:hover { border-color: rgba(184, 74, 22, 0.34); background: var(--surface-muted, rgba(22, 40, 64, 0.02)); }

/* Responsive Tabellen: sekundäre Spalten auf schmalen Screens ausblenden */
@media (max-width: 860px) {
  .col-hide-md { display: none !important; }
  table { min-width: 0; }
  th, td { padding: 0.6rem 0.5rem; }
}
@media (max-width: 560px) {
  .col-hide-sm { display: none !important; }
}

/* ---- Benachrichtigungen: Glocke + Liste ------------------------------ */
.client-bell, .appbar-bell {
  position: relative; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 999px;
  color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}
.client-bell:hover, .appbar-bell:hover { background: rgba(255, 255, 255, 0.12); }
.appbar-bell { margin-left: auto; }
.client-bell .badge-count, .appbar-bell .badge-count {
  position: absolute; top: -5px; right: -5px; margin: 0;
  min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.66rem;
  box-shadow: 0 0 0 2px var(--navy, #162840);
}
.js-notif-count[hidden] { display: none !important; }

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notif-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.9rem 0.6rem;
  border-bottom: 1px solid var(--line, rgba(22, 40, 64, 0.1));
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: var(--action-soft, rgba(184, 74, 22, 0.07)); border-radius: var(--kp-r-sm, 10px); }
.notif-ic {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--action-soft, rgba(184, 74, 22, 0.1)); color: var(--action, #b84a16);
}
.notif-body { display: grid; gap: 0.15rem; flex: 1; min-width: 0; }
.notif-body strong { font-weight: 600; }
.notif-body p { margin: 0; color: var(--text, #162840); font-size: 0.92rem; }
.notif-body small { color: var(--muted, #6b7060); font-size: 0.78rem; }
.notif-item.is-unread .notif-body strong::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 0.4rem;
  border-radius: 999px; background: var(--action, #b84a16); vertical-align: middle;
}
.notif-link { flex: 0 0 auto; align-self: center; color: var(--muted, #6b7060); }
.notif-link:hover { color: var(--action, #b84a16); }

/* ---- Admin: „Wartet auf Sie" ---------------------------------------- */
.priority-panel .wait-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.wait-row {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.6rem;
  border-radius: var(--kp-r-sm); text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: background var(--kp-dur-fast, 140ms) ease;
}
.priority-panel .wait-list li:last-child .wait-row { border-bottom: 0; }
.wait-row:hover { background: var(--surface-muted); }
.wait-body { display: grid; gap: 0.15rem; flex: 1; min-width: 0; }
.wait-top { display: flex; align-items: baseline; gap: 0.5rem; }
.wait-top strong { font-weight: 600; }
.wait-top small { font-size: 0.8rem; }
.wait-ex { color: var(--muted); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-meta { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.wait-row:hover .wait-meta { color: var(--action); }

/* ---- Kunde: „Ihr nächster Schritt" ---------------------------------- */
.nextstep {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--action); background: var(--action-soft);
  border-radius: var(--kp-r-lg);
}
.nextstep-ic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  background: var(--action); color: #fff; display: grid; place-items: center;
}
.nextstep-text { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.nextstep-text h2 { margin: 0; font-size: 1.15rem; }
.nextstep .button { flex: 0 0 auto; }
@media (max-width: 640px) {
  .nextstep { flex-direction: column; align-items: flex-start; }
  .nextstep .button { width: 100%; justify-content: center; }
}

/* ---- Aufgaben / Kanban ---------------------------------------------- */
.badge-warn { background: var(--warn-soft, rgba(184, 118, 26, 0.14)); color: #8a5a12; }

.progress-line { display: flex; align-items: center; gap: 0.8rem; margin: 0.5rem 0 0.2rem; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.progress-fill { height: 100%; background: var(--action); border-radius: 999px; transition: width var(--kp-dur) var(--kp-ease); }
.progress-label { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.task-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.task-add .task-add-title { flex: 1; min-width: 200px; }
.task-add input[type="text"], .task-add input[type="date"], .task-add select {
  padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: var(--kp-r-sm);
  font: inherit; background: var(--surface); color: var(--text);
}
.task-add-kv { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; align-items: start; }
.kanban-col { background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--kp-r-md); padding: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.kanban-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--muted); font-size: 0.72rem; display: inline-grid; place-items: center; }
.kanban-cards { display: flex; flex-direction: column; gap: 0.55rem; min-height: 24px; }
.kanban-empty { text-align: center; font-size: 0.85rem; margin: 0.2rem 0; }

.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--kp-r-sm); padding: 0.6rem 0.7rem; display: grid; gap: 0.45rem; box-shadow: var(--kp-shadow-sm); }
.task-title { font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.task-meta .prio { font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.prio-hoch { background: rgba(179, 38, 30, 0.1); color: #a3261e; }
.prio-mittel { background: var(--action-soft); color: var(--action-hover); }
.prio-niedrig { background: rgba(22, 40, 64, 0.08); color: var(--muted); }
.task-meta .due { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.due.due-overdue { color: #a3261e; }
.due.due-today { color: var(--action-hover); }
.task-kv { color: var(--action); display: inline-flex; }
.task-actions { display: flex; align-items: center; gap: 0.25rem; }
.task-actions form { margin: 0; }
.task-actions .task-del { margin-left: auto; }

.due-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.due-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.due-list li:last-child .due-row { border-bottom: 0; }
.due-row:hover { background: var(--surface-muted); border-radius: var(--kp-r-sm); }
.due-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); flex: none; }
.due-dot.due-overdue { background: #c0392b; }
.due-dot.due-today { background: var(--action); }
.due-main { display: grid; gap: 0.1rem; flex: 1; min-width: 0; }
.due-main small { font-size: 0.78rem; }
.due-when { font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.due-when.due-overdue { color: #c0392b; }
.due-when.due-today { color: var(--action); }

@media (max-width: 860px) { .kanban { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .kanban { grid-template-columns: 1fr; } }

/* ---- Kundensichtbare Aufgaben (Projektseite) ------------------------ */
.ctask-list { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; }
.ctask { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.1rem; border-bottom: 1px solid var(--line); }
.ctask:last-child { border-bottom: 0; }
.ctask-ic { flex: none; color: var(--action); display: inline-flex; }
.ctask.is-done .ctask-ic { color: #1d8a5f; }
.ctask-main { display: grid; gap: 0.1rem; flex: 1; min-width: 0; }
.ctask-main .due { font-size: 0.78rem; color: var(--muted); }
.ctask-main .due.due-overdue { color: #c0392b; }
.ctask.is-done .ctask-main strong { color: var(--muted); text-decoration: line-through; }
.ctask-status { font-size: 0.76rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

.progress-line.compact { margin: 0.1rem 0; gap: 0.5rem; }
.progress-line.compact .progress-track { height: 6px; }
.progress-line.compact .progress-label { font-size: 0.76rem; }

/* ---- Meilensteine / Freigabe ---------------------------------------- */
.ms-list { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-direction: column; }
.ms-item { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.75rem 0.1rem; border-bottom: 1px solid var(--line); }
.ms-item:last-child { border-bottom: 0; }
.ms-check { flex: none; color: var(--muted); margin-top: 1px; }
.ms-check.is-done { color: #1d8a5f; }
.ms-main { flex: 1; min-width: 0; display: grid; gap: 0.3rem; }
.ms-main > strong { font-weight: 600; }
.ms-sub { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ms-comment { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); display: flex; align-items: flex-start; gap: 0.35rem; }
.ms-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.ms-waiting { font-size: 0.78rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.ms-decide { margin-top: 0.2rem; display: grid; gap: 0.4rem; }
.ms-decide textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: var(--kp-r-sm); font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.ms-decide-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge.ms-offen { background: rgba(22, 40, 64, 0.08); color: var(--muted); }
.badge.ms-zur_abnahme { background: var(--warn-soft, rgba(184, 118, 26, 0.14)); color: #8a5a12; }
.badge.ms-freigegeben { background: rgba(29, 138, 95, 0.12); color: #1d8a5f; }
.badge.ms-aenderung { background: rgba(179, 38, 30, 0.1); color: #a3261e; }

/* ---- Kanban Drag & Drop --------------------------------------------- */
.task-card { cursor: grab; }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.45; }
.kanban-cards { min-height: 40px; }
.kanban-cards.drag-over { outline: 2px dashed var(--action); outline-offset: 2px; border-radius: var(--kp-r-sm); }

/* ---- Zeiterfassung --------------------------------------------------- */
.time-total { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.time-min { max-width: 120px; }
.time-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.time-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.1rem; border-bottom: 1px solid var(--line); }
.time-row:last-child { border-bottom: 0; }
.time-dur { font-weight: 700; min-width: 64px; }
.time-main { flex: 1; min-width: 0; }
.time-date { font-size: 0.8rem; white-space: nowrap; }

/* ====================== DARK MODE ===================================== */
:root[data-theme="dark"] {
  --bg: #0f1824; --bg-soft: #14202e; --surface: #1a2734; --surface-muted: #16212e;
  --text: #e8edf4; --muted: #9caaba; --line: rgba(255,255,255,0.10); --line-strong: rgba(255,255,255,0.20);
  --navy: #16263a; --navy-mid: #1d3350;
  --action: #d2622b; --action-hover: #e6743a; --action-soft: rgba(210,98,43,0.20);
  --forest: #4f9e6a; --forest-soft: rgba(79,158,106,0.20); --amber-soft: rgba(210,150,70,0.20);
  --danger: #e07070; --danger-soft: rgba(224,112,112,0.16);
  --shadow: 0 18px 44px rgba(0,0,0,0.55);
  --kp-shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --kp-shadow-md: 0 2px 4px rgba(0,0,0,0.35), 0 18px 40px rgba(0,0,0,0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1824; --bg-soft: #14202e; --surface: #1a2734; --surface-muted: #16212e;
    --text: #e8edf4; --muted: #9caaba; --line: rgba(255,255,255,0.10); --line-strong: rgba(255,255,255,0.20);
    --navy: #16263a; --navy-mid: #1d3350;
    --action: #d2622b; --action-hover: #e6743a; --action-soft: rgba(210,98,43,0.20);
    --forest: #4f9e6a; --forest-soft: rgba(79,158,106,0.20); --amber-soft: rgba(210,150,70,0.20);
    --danger: #e07070; --danger-soft: rgba(224,112,112,0.16);
    --shadow: 0 18px 44px rgba(0,0,0,0.55);
    --kp-shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
    --kp-shadow-md: 0 2px 4px rgba(0,0,0,0.35), 0 18px 40px rgba(0,0,0,0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] input[readonly],
:root[data-theme="dark"] .credential-box input { background: var(--surface-muted); color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] input[readonly],
  :root[data-theme="auto"] .credential-box input { background: var(--surface-muted); color: var(--text); }
}

/* ---- Theme toggle ---------------------------------------------------- */
.theme-toggle {
  display: inline-grid; place-items: center; grid-auto-flow: column; gap: 0.6rem;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06);
  color: #fff; cursor: pointer; transition: background .15s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); }
.theme-ic { display: none; }
:root[data-theme="auto"] .theme-ic-auto,
:root:not([data-theme]) .theme-ic-auto { display: inline-grid; }
:root[data-theme="light"] .theme-ic-light { display: inline-grid; }
:root[data-theme="dark"] .theme-ic-dark { display: inline-grid; }
.theme-label { display: none; }
.sb-foot .theme-toggle {
  width: 100%; height: auto; justify-content: flex-start;
  padding: 0.55rem 0.7rem; border-radius: var(--kp-r-sm);
  color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.9rem;
}
.sb-foot .theme-toggle .theme-label { display: inline; }

/* ---- Theme segmented control ---------------------------------------- */
.theme-seg{display:inline-flex;gap:2px;padding:3px;border-radius:999px;border:1px solid rgba(255,255,255,0.18);background:rgba(255,255,255,0.06);}
.theme-opt{display:inline-flex;align-items:center;gap:.35rem;padding:.34rem .55rem;border:0;background:transparent;color:rgba(255,255,255,0.68);border-radius:999px;cursor:pointer;font-size:.8rem;font-weight:600;line-height:1;transition:background .15s ease,color .15s ease;}
.theme-opt:hover{color:#fff;}
:root[data-theme="auto"] .theme-opt[data-theme-set="auto"],
:root:not([data-theme]) .theme-opt[data-theme-set="auto"],
:root[data-theme="light"] .theme-opt[data-theme-set="light"],
:root[data-theme="dark"] .theme-opt[data-theme-set="dark"]{background:var(--action);color:#fff;}
.sb-foot .theme-seg{display:flex;justify-content:space-between;width:100%;}
.sb-foot .theme-opt{flex:1;justify-content:center;}
@media (max-width:420px){.theme-opt span{display:none;}}

/* ---- Form row (zweispaltig, z. B. PLZ/Ort) -------------------------- */
.form-row{display:grid;grid-template-columns:1fr 2fr;gap:.8rem;}
@media (max-width:520px){.form-row{grid-template-columns:1fr;}}

/* ---- Support-Modus (Impersonation) ---------------------------------- */
.imp-bar{position:fixed;left:0;right:0;bottom:0;z-index:100;display:flex;align-items:center;justify-content:center;gap:1rem;flex-wrap:wrap;padding:.6rem 1rem;background:#9f1d1d;color:#fff;font-size:.9rem;font-weight:600;box-shadow:0 -6px 20px rgba(0,0,0,.3);}
.imp-bar .imp-text{display:inline-flex;align-items:center;gap:.5rem;}
.imp-form{margin:0;}
.imp-back{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .8rem;border-radius:999px;border:1px solid rgba(255,255,255,.6);background:rgba(255,255,255,.12);color:#fff;font-weight:700;font-size:.85rem;cursor:pointer;}
.imp-back:hover{background:rgba(255,255,255,.22);}

/* ---- Onboarding-Intro-Karte (Kunde) --------------------------------- */
.intro-card{position:relative;background:linear-gradient(135deg,var(--navy),var(--navy-mid));color:#fff;border-radius:var(--kp-r-lg);padding:1.4rem 1.5rem;box-shadow:var(--kp-shadow-sm);}
.intro-card .eyebrow{color:#ff9d63;}
.intro-card h2{margin:.1rem 0 1rem;color:#fff;}
.intro-x{position:absolute;top:.8rem;right:.8rem;display:inline-grid;place-items:center;width:30px;height:30px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;cursor:pointer;}
.intro-x:hover{background:rgba(255,255,255,.18);}
.intro-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;}
.intro-step{display:flex;gap:.7rem;align-items:flex-start;}
.intro-step strong{display:block;margin-bottom:.15rem;}
.intro-step .muted{color:rgba(255,255,255,.72);font-size:.88rem;margin:0;}
.intro-num{flex:0 0 auto;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:999px;background:var(--action);color:#fff;font-weight:700;font-size:.85rem;}
@media (max-width:720px){.intro-steps{grid-template-columns:1fr;}}

/* ---- Kennzahl-Kontext ----------------------------------------------- */
.stat-ctx{display:block;margin-top:.2rem;font-size:.76rem;font-weight:600;color:var(--muted);}
.stat-ctx.stat-up{color:var(--forest);}
.stat-ctx.stat-warn{color:var(--action-hover);}

/* ---- Mikrointeraktionen & Politur ----------------------------------- */
@media (prefers-reduced-motion: no-preference){
  .panel,.project-card,.stats>div,.file-row,.wait-row,.due-row{transition:transform var(--kp-dur-fast) var(--kp-ease),box-shadow var(--kp-dur-fast) var(--kp-ease),border-color var(--kp-dur-fast) var(--kp-ease);}
  .project-card:hover,.stats>div:hover{transform:translateY(-2px);box-shadow:var(--kp-shadow-md);}
  .shell>*{animation:kp-rise var(--kp-dur) var(--kp-ease) both;}
  @keyframes kp-rise{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}
}
.button:active{transform:translateY(1px);}
:where(a,button,input,select,textarea):focus-visible{outline:2px solid var(--action);outline-offset:2px;}

/* ---- Support-Button in Tabellen/Aktionen ---------------------------- */
.row-actions form{margin:0;display:inline-flex;}
button.icon-btn{font:inherit;}
.icon-btn.support:hover{color:var(--forest);border-color:rgba(45,90,61,.4);background:var(--forest-soft);}

/* ===================================================================== */
/* Konsistenz mit der Hauptwebsite wwdigitalwerk.de                       */
/* ===================================================================== */
@font-face{font-family:"Inter Variable";font-style:normal;font-display:swap;font-weight:100 900;src:url("/assets/fonts/inter-variable.woff2") format("woff2");}
@font-face{font-family:"Fraunces";font-style:normal;font-display:swap;font-weight:100 900;src:url("/assets/fonts/fraunces-variable.woff2") format("woff2");}
body.app{font-family:"Inter Variable",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-feature-settings:"cv11","ss01";font-optical-sizing:auto;}
body.app h1, body.app h2, body.app h3{font-family:"Fraunces","Iowan Old Style","Palatino Linotype",Georgia,serif;letter-spacing:-0.01em;text-wrap:balance;}

/* Pillen-Buttons wie Hauptseite */
body.app .button, body.app .button-secondary, body.app .button-danger{border-radius:999px;}
/* Ruhigere, größere Radien für Karten/Panels */
body.app .hero-band{border-radius:20px;}
body.app .panel, body.app .project-card, body.app .side-panel, body.app .intro-card, body.app .kanban-col, body.app .task-card{border-radius:18px;}

/* Sticky-Footer: Inhalt füllt die Höhe, Footer sitzt immer unten */
body.shell-admin .app-main > .shell, body.shell-client .app-main > .shell{flex:1 0 auto;}
body.shell-auth{display:flex;flex-direction:column;min-height:100vh;}
body.shell-auth > main.shell{flex:1 0 auto;}

/* Dark Mode exakt an Hauptseite angeglichen (Navy-Schwarz) */
:root[data-theme="dark"]{
  --bg:#0b1220;--bg-soft:#111b2d;--surface:#121c2e;--surface-muted:#0f1828;
  --text:#f4f7fb;--muted:#b8c3d4;--line:rgba(255,255,255,.10);--line-strong:rgba(255,255,255,.20);
  --navy:#162840;--navy-mid:#1d3350;--action:#f08a4b;--action-hover:#ff9d63;--action-soft:rgba(240,138,75,.16);
  --forest:#47895b;--forest-soft:rgba(71,137,91,.18);--danger:#e07070;--shadow:0 18px 48px rgba(0,0,0,.5);
}
@media (prefers-color-scheme:dark){:root[data-theme="auto"]{
  --bg:#0b1220;--bg-soft:#111b2d;--surface:#121c2e;--surface-muted:#0f1828;
  --text:#f4f7fb;--muted:#b8c3d4;--line:rgba(255,255,255,.10);--line-strong:rgba(255,255,255,.20);
  --navy:#162840;--navy-mid:#1d3350;--action:#f08a4b;--action-hover:#ff9d63;--action-soft:rgba(240,138,75,.16);
  --forest:#47895b;--forest-soft:rgba(71,137,91,.18);--danger:#e07070;--shadow:0 18px 48px rgba(0,0,0,.5);
}}

/* Projekt-Karten ruhiger/übersichtlicher */
body.app .project-card{gap:.55rem;padding:1.35rem 1.4rem;}
body.app .project-card h3{font-size:1.18rem;}
body.app .project-card .actions{margin-top:.4rem;display:flex;align-items:center;gap:.9rem;flex-wrap:wrap;}

/* ---- Quick-Actions / Vorschau-Erklärung ----------------------------- */
body.app .quick-actions{display:flex;flex-direction:column;gap:.75rem;}
.qa-help{display:flex;gap:.55rem;align-items:flex-start;margin:0;color:var(--muted);font-size:.9rem;line-height:1.45;background:var(--action-soft);border:1px solid var(--line);border-radius:14px;padding:.7rem .9rem;}
.qa-help .ic{flex:0 0 auto;color:var(--action);margin-top:.12rem;}
.qa-help strong{color:var(--text);}
.qa-buttons{display:flex;flex-wrap:wrap;gap:.7rem;align-items:center;}

/* ===== Mobile-Menü (von oben, Schließen rechts) + Theme höher + PW-Stärke ===== */
.sb-theme{padding:.55rem .15rem .2rem;}
.burger-open{display:inline-flex;align-items:center;}
.burger-close{display:none;align-items:center;}
.nav-cb:checked ~ .app-main .nav-burger .burger-open{display:none;}
.nav-cb:checked ~ .app-main .nav-burger .burger-close{display:inline-flex;}

@media (max-width:900px){
  .appbar{z-index:45;}
  .appbar-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .nav-burger{order:3;margin-left:.25rem;}
  .appbar-bell{margin-left:0;}
  .sidebar{
    top:54px;left:0;right:0;width:auto;height:auto;max-height:calc(100dvh - 54px);
    transform:translateY(-118%);transition:transform .26s ease;
    border-right:0;border-bottom:1px solid rgba(255,255,255,.10);
    border-radius:0 0 16px 16px;overflow-y:auto;padding-top:.6rem;
  }
  .nav-cb:checked ~ .sidebar{transform:translateY(0);}
  .nav-cb:checked ~ .nav-scrim{top:54px;}
}

/* Passwort-Stärke (kundenfreundlich) */
.pw-meter{height:7px;border-radius:999px;background:var(--line-strong);overflow:hidden;margin:.15rem 0;}
.pw-bar{display:block;height:100%;width:0;border-radius:999px;background:var(--danger);transition:width .2s ease,background .2s ease;}
.pw-bar.s1{width:28%;background:#c0392b;}
.pw-bar.s2{width:52%;background:#d98324;}
.pw-bar.s3{width:78%;background:#c9a13a;}
.pw-bar.s4{width:100%;background:var(--forest);}
.pw-hint{font-size:.85rem;margin:.1rem 0 0;}
.pw-strength{font-weight:700;}

/* ---- Passwort-Helfer: Kriterien-Checkliste + gesperrter Button ------ */
.pw-feedback{display:grid;gap:.3rem;margin:.15rem 0 .1rem;}
.pw-strength-label{font-size:.85rem;margin:0;}
.pw-reqs{list-style:none;margin:.15rem 0 0;padding:0;display:grid;gap:.2rem;font-size:.82rem;}
.pw-reqs li{position:relative;padding-left:1.4rem;color:var(--muted);}
.pw-reqs li::before{content:"○";position:absolute;left:0;color:var(--muted);font-weight:700;}
.pw-reqs li.ok{color:var(--forest);}
.pw-reqs li.ok::before{content:"✓";color:var(--forest);}
.button.is-disabled,.button:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none;}

/* ---- WebAuthn: Schlüssel-Liste + Status ----------------------------- */
.wa-list{list-style:none;margin:.5rem 0 0;padding:0;display:grid;gap:.5rem;}
.wa-list li{display:flex;align-items:center;gap:.7rem;padding:.6rem .7rem;border:1px solid var(--line);border-radius:var(--kp-r-sm);background:var(--surface-muted);}
.wa-list .wa-ic{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--action-soft);color:var(--action);flex:0 0 auto;}
.wa-info{display:grid;flex:1;min-width:0;}
.wa-info strong{font-weight:600;}
.wa-info small{font-size:.8rem;}
.wa-list form{margin:0;}
.wa-add{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.7rem;margin-top:.9rem;}
.wa-name-label{display:grid;gap:.3rem;flex:1;min-width:200px;}
.wa-status{margin:.5rem 0 0;font-size:.9rem;font-weight:600;min-height:1.2em;}
.wa-status.wa-ok{color:var(--forest);}
.wa-status.wa-err{color:var(--danger);}

/* --- Audit-Protokoll --- */
.log-filter { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .8rem; align-items: end; margin-bottom: 1rem; }
.log-filter .field { margin: 0; }
.log-filter-actions { display: flex; gap: .5rem; }
.log-count { margin: .2rem 0 1rem; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.log-row { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--border, rgba(22,40,64,.1)); border-radius: 12px; background: var(--surface, #fff); }
.log-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; background: var(--action-soft, rgba(184,74,22,.1)); color: var(--action); margin-top: 1px; }
.log-body { display: grid; gap: .15rem; min-width: 0; }
.log-body strong { color: var(--text, #162840); }
.log-detail { color: var(--muted, #6b7060); overflow-wrap: anywhere; }
.log-body small { color: var(--muted, #6b7060); }
.log-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.2rem; }
.log-pager-info { color: var(--muted, #6b7060); font-size: .92rem; }
@media (max-width: 720px) { .log-filter { grid-template-columns: 1fr; } .log-filter-actions { justify-content: stretch; } .log-filter-actions .button { flex: 1; } }

/* --- Dokumente (Admin) --- */
.doc-admin-row { display: flex; align-items: center; gap: .4rem; }
.doc-admin-row .file-row { flex: 1; min-width: 0; }
.doc-del-form { margin: 0; }
.doc-upload-form { margin-top: 1rem; display: grid; gap: .7rem; padding-top: 1rem; border-top: 1px solid var(--border, rgba(22,40,64,.1)); }
.doc-upload-grid { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .doc-upload-grid { grid-template-columns: 1fr; } }

/* --- Fix: Seitenpanels nicht mehr sticky (Unterlagen verschwand hinter Ansprechpartner) --- */
.side-panel { position: static; top: auto; }
/* Live-Suche Ladezustand */
#log-results.is-loading { opacity: .55; transition: opacity .12s ease; }

/* --- Listen-Suchfeld (Live-Filter) --- */
.list-search { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; margin-bottom: .9rem;
  border: 1px solid var(--border, rgba(22,40,64,.12)); border-radius: 999px; background: var(--surface, #fff); color: var(--muted, #6b7060); }
.list-search:focus-within { border-color: rgba(184,74,22,.45); }
.list-search input { border: 0; background: transparent; flex: 1; min-width: 0; font: inherit; color: var(--text, #162840); outline: none; padding: 0; }
.list-search input::placeholder { color: var(--muted, #6b7060); }

/* --- Konversations-Kopf (Nachrichten-Detail) --- */
.convo-head { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }

/* Auth: sekundärer Link unter dem Formular */
.auth-alt { margin: .9rem 0 0; text-align: center; font-size: .92rem; }

/* Login: Premium Split-Layout – Marken-Panel (links) + Formular (rechts) */
.auth-split {
  width: 100%; max-width: 940px; margin: clamp(1.5rem, 5vh, 4rem) auto;
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface, #fffdf8);
  border: 1px solid var(--line, rgba(22,40,64,.12));
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(11,18,32,.5);
}
.auth-brand {
  position: relative; padding: 2.4rem 2.2rem;
  display: flex; flex-direction: column; gap: 1.6rem; color: #eaf0fb;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(240,138,75,.18), transparent 55%),
    linear-gradient(165deg, #13203a 0%, #0b1220 100%);
}
.auth-brand-top { display: flex; align-items: center; gap: .7rem; }
.auth-brand-mark { width: 40px; height: 40px; border-radius: 11px; display: block; }
.auth-brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand-name strong { font-size: 1.02rem; letter-spacing: -.01em; color: #fff; }
.auth-brand-name small { font-size: .78rem; color: rgba(234,240,251,.62); }
.auth-brand-list { list-style: none; margin: auto 0; padding: 0; display: flex; flex-direction: column; gap: .95rem; }
.auth-brand-list li { display: flex; align-items: flex-start; gap: .6rem; font-size: .96rem; line-height: 1.35; color: rgba(234,240,251,.9); }
.auth-brand-list li svg { flex: none; margin-top: .1rem; color: #f3a06a; }
.auth-brand-trust { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .8rem; color: rgba(234,240,251,.6); }
.auth-brand-trust svg { flex: none; }
.auth-split .auth-panel {
  margin: 0; max-width: none; width: auto;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
  padding: 2.6rem 2.3rem;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 760px) {
  .auth-split { grid-template-columns: 1fr; max-width: 460px; margin: 1.2rem auto; }
  .auth-brand { display: none; }
  .auth-split .auth-panel { padding: 1.9rem 1.5rem; }
}

/* A11y: Skip-Link – nur bei Tastaturfokus sichtbar */
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 200; padding: .6rem .9rem; border-radius: 0 0 10px 10px;
  background: var(--action, #b84a16); color: #fff; font-weight: 600; text-decoration: none; transition: top .15s ease; }
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 2px; }
main#main:focus { outline: none; }

/* ===========================================================================
   PREMIUM PASS v3 (Stripe/SaaS) – crisp, hell, dezente Verläufe, feine Schatten
   Lädt zuletzt und überschreibt bewusst frühere Werte. Marke (Navy/Orange) bleibt.
   =========================================================================== */
:root {
  --bg: #f3f5f8;
  --bg-soft: #eaeef3;
  --surface: #ffffff;
  --surface-muted: #f6f8fb;
  --line: rgba(18, 38, 63, 0.10);
  --line-strong: rgba(18, 38, 63, 0.16);
  --kp-r-sm: 10px;
  --kp-r-md: 14px;
  --kp-r-lg: 20px;
  --kp-shadow-sm: 0 1px 2px rgba(16, 33, 60, 0.06), 0 1px 3px rgba(16, 33, 60, 0.04);
  --kp-shadow-md: 0 2px 4px rgba(16, 33, 60, 0.05), 0 14px 30px -12px rgba(16, 33, 60, 0.18);
  --kp-shadow-lg: 0 6px 12px rgba(16, 33, 60, 0.07), 0 28px 60px -18px rgba(16, 33, 60, 0.24);
  --ring: 0 0 0 3px rgba(184, 74, 22, 0.22);
}

/* Premium-Hintergrund: sehr dezente Farbverläufe, crisp */
body.app {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(184, 74, 22, 0.05), transparent 58%),
    radial-gradient(1000px 520px at -8% 0%, rgba(22, 40, 64, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- Karten / Panels: weiß, Haarlinie, feiner Layer-Schatten ---- */
.panel, .side-panel, .intro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--kp-r-lg);
  box-shadow: var(--kp-shadow-sm);
}
.stats > div, .project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--kp-r-md);
  box-shadow: var(--kp-shadow-sm);
  transition: transform var(--kp-dur-fast) var(--kp-ease), box-shadow var(--kp-dur-fast) var(--kp-ease), border-color var(--kp-dur-fast) var(--kp-ease);
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--kp-shadow-md);
  border-color: rgba(184, 74, 22, 0.32);
}
.stats > div:hover { box-shadow: var(--kp-shadow-md); transform: translateY(-2px); }

/* ---- Hero: premium Navy-Verlauf mit feinem Glow + Top-Highlight ---- */
.hero-band {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--kp-r-lg);
  background:
    radial-gradient(120% 140% at 88% -20%, rgba(240, 138, 75, 0.28), transparent 46%),
    radial-gradient(90% 120% at 0% 0%, rgba(63, 96, 150, 0.55), transparent 50%),
    linear-gradient(135deg, #11233b, #1b3354 60%, #0e1f35 100%);
  background-color: #14263d;
  box-shadow: var(--kp-shadow-md);
}
.hero-band::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}
.hero-band > * { position: relative; z-index: 1; }

/* ---- Buttons: Premium mit dezentem Verlauf + farbigem Schatten ---- */
.button {
  background: linear-gradient(180deg, #c85420, var(--action));
  border: 1px solid rgba(150, 54, 13, 0.6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -6px rgba(184, 74, 22, 0.6);
  transition: transform var(--kp-dur-fast) var(--kp-ease), box-shadow var(--kp-dur-fast) var(--kp-ease), filter var(--kp-dur-fast) var(--kp-ease);
}
.button:hover { transform: translateY(-1px); filter: saturate(1.06); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 22px -6px rgba(184,74,22,.6); }
.button:active { transform: translateY(0); }
.button-secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--kp-shadow-sm);
  transition: transform var(--kp-dur-fast) var(--kp-ease), box-shadow var(--kp-dur-fast) var(--kp-ease), border-color var(--kp-dur-fast) var(--kp-ease);
}
.button-secondary:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--kp-shadow-md); }

/* ---- Formularfelder: crisp, klarer Fokus-Ring ---- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--kp-r-sm);
  transition: border-color var(--kp-dur-fast) var(--kp-ease), box-shadow var(--kp-dur-fast) var(--kp-ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: var(--ring); }

/* ---- Tabellen: ruhige, strukturierte SaaS-Optik ---- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--kp-r-md); overflow: hidden; background: var(--surface); }
table thead th {
  background: var(--surface-muted);
  text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
table tbody td { border-bottom: 1px solid var(--line); }
table tbody tr:last-child td { border-bottom: 0; }
table tbody tr { transition: background var(--kp-dur-fast) var(--kp-ease); }
table tbody tr:hover { background: var(--surface-muted); }

/* ---- Typografie-Feinschliff ---- */
h1 { letter-spacing: -0.015em; }
h2, h3 { letter-spacing: -0.01em; }
.eyebrow { letter-spacing: .12em; }

/* ---- Fokus-Stil (A11y) global premium ---- */
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 4px; }

/* ===========================================================================
   SIDEBAR: Kopf mit Einklapp-Button + eingeklappter Zustand (Desktop)
   =========================================================================== */
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.sb-collapse {
  flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.8); cursor: pointer; transition: background .15s ease, color .15s ease, transform .2s ease;
}
.sb-collapse:hover { background: rgba(255,255,255,.12); color: #fff; }

@media (min-width: 901px) {
  html[data-sidebar="collapsed"] body.shell-admin,
  html[data-sidebar="collapsed"] body.shell-client { grid-template-columns: 76px minmax(0, 1fr); }
  html[data-sidebar="collapsed"] .sidebar { padding-left: .5rem; padding-right: .5rem; }
  html[data-sidebar="collapsed"] .sb-brand-text,
  html[data-sidebar="collapsed"] .sb-link span:not(.badge-count),
  html[data-sidebar="collapsed"] .sb-account-name,
  html[data-sidebar="collapsed"] .sb-link-sub span,
  html[data-sidebar="collapsed"] .sb-logout span,
  html[data-sidebar="collapsed"] .theme-opt span { display: none; }
  html[data-sidebar="collapsed"] .sb-head { flex-direction: column; gap: .5rem; }
  html[data-sidebar="collapsed"] .sb-brand { padding: .35rem; justify-content: center; }
  html[data-sidebar="collapsed"] .sb-link,
  html[data-sidebar="collapsed"] .sb-logout { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-sidebar="collapsed"] .sb-link { position: relative; }
  html[data-sidebar="collapsed"] .sb-link .badge-count {
    position: absolute; top: 4px; right: 8px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
  html[data-sidebar="collapsed"] .sb-account { justify-content: center; }
  html[data-sidebar="collapsed"] .sb-collapse { transform: rotate(180deg); }
  html[data-sidebar="collapsed"] .theme-seg { flex-direction: column; gap: 3px; }
  html[data-sidebar="collapsed"] .theme-opt { padding: .4rem; }
}

/* ===========================================================================
   SKELETON-LOADER
   =========================================================================== */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-muted);
  border-radius: 8px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(120,140,170,.14), transparent);
  transform: translateX(-100%);
  animation: kp-shimmer 1.3s ease-in-out infinite;
}
@keyframes kp-shimmer { 100% { transform: translateX(100%); } }
.skeleton-list { display: grid; gap: .55rem; }
.skeleton-row { height: 54px; border-radius: var(--kp-r-sm); }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* ===========================================================================
   COMMAND PALETTE (⌘K)
   =========================================================================== */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 120; display: none;
  background: rgba(11, 18, 32, 0.46); backdrop-filter: blur(3px);
  padding: 12vh 16px 16px;
}
.cmdk-overlay.is-open { display: block; }
.cmdk-box {
  max-width: 600px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--kp-r-lg);
  box-shadow: var(--kp-shadow-lg); overflow: hidden;
  animation: cmdk-in .14s var(--kp-ease);
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.cmdk-head .ic { color: var(--muted); flex: 0 0 auto; }
.cmdk-input { flex: 1; border: 0; background: transparent; font-size: 1.02rem; color: var(--text); outline: none; }
.cmdk-hint { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.cmdk-list { max-height: 52vh; overflow: auto; padding: .4rem; }
.cmdk-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .5rem .6rem .25rem; }
.cmdk-item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--kp-r-sm);
  color: var(--text); text-decoration: none; cursor: pointer;
}
.cmdk-item .ic { color: var(--muted); flex: 0 0 auto; }
.cmdk-item small { color: var(--muted); margin-left: auto; }
.cmdk-item.is-active, .cmdk-item:hover { background: var(--action-soft); }
.cmdk-item.is-active .ic { color: var(--action); }
.cmdk-empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .7rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: .85rem; cursor: pointer; box-shadow: var(--kp-shadow-sm);
}
.cmdk-trigger:hover { color: var(--text); border-color: var(--line-strong); }
.cmdk-trigger kbd { font: inherit; font-size: .72rem; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

/* ===========================================================================
   DARK-MODE: Premium-Anpassung (Schatten dezenter, Ränder tragen Trennung)
   =========================================================================== */
:root[data-theme="dark"] {
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --kp-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --kp-shadow-md: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.7);
  --kp-shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 30px 60px -18px rgba(0,0,0,.75);
  --ring: 0 0 0 3px rgba(240, 138, 75, 0.28);
}
:root[data-theme="dark"] body.app {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(240, 138, 75, 0.07), transparent 58%),
    radial-gradient(1000px 520px at -8% 0%, rgba(63, 96, 150, 0.10), transparent 55%),
    var(--bg);
}
:root[data-theme="dark"] .button-secondary { background: var(--surface); }
:root[data-theme="dark"] table thead th { background: rgba(255,255,255,.03); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --kp-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --kp-shadow-md: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.7);
    --kp-shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 30px 60px -18px rgba(0,0,0,.75);
    --ring: 0 0 0 3px rgba(240, 138, 75, 0.28);
  }
  :root[data-theme="auto"] body.app {
    background:
      radial-gradient(1100px 560px at 100% -8%, rgba(240, 138, 75, 0.07), transparent 58%),
      radial-gradient(1000px 520px at -8% 0%, rgba(63, 96, 150, 0.10), transparent 55%),
      var(--bg);
  }
}

/* Such-Trigger in der Sidebar */
.cmdk-open { width: 100%; cursor: pointer; text-align: left; font: inherit; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }
.cmdk-open:hover { background: rgba(255,255,255,.1); }
.sb-kbd { margin-left: auto; font-size: .68rem; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 1px 5px; }
html[data-sidebar="collapsed"] .sb-kbd { display: none; }

/* WebAuthn-Wiederherstellungscodes */
.wa-recovery { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.wa-recovery h3 { margin: 0 0 .3rem; }
.wa-recovery-out { margin-top: .8rem; }
.wa-recovery-warn { color: var(--action); font-weight: 600; margin: 0 0 .5rem; }
.wa-recovery-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem; }
.wa-recovery-codes li { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95rem; letter-spacing: .04em; padding: .5rem .7rem; background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--kp-r-sm); }
@media (max-width: 520px) { .wa-recovery-codes { grid-template-columns: 1fr; } }
.wa-recovery-login { margin-top: .8rem; border: 1px solid var(--line); border-radius: var(--kp-r-sm); padding: .6rem .8rem; background: var(--surface); }
.wa-recovery-login summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.wa-recovery-login[open] summary { color: var(--text); margin-bottom: .3rem; }

/* ===========================================================================
   PREMIUM PASS v4 — Dark-Mode: ruhige, fast-schwarze Sidebar/Topbar statt
   navy-blauem Farbblock (wie Linear/Vercel). Farbe nur beim aktiven Eintrag.
   =========================================================================== */
:root[data-theme="dark"] .sidebar {
  background: var(--surface, #121c2e);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
:root[data-theme="dark"] .topbar.client,
:root[data-theme="dark"] .topbar.bare {
  background: var(--surface, #121c2e);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
:root[data-theme="dark"] .appbar {
  background: var(--surface, #121c2e);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
/* Aktiver Nav-Eintrag: dezent, Akzent nur als linke Kante */
:root[data-theme="dark"] .sb-link.is-active {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 3px 0 0 var(--action);
}
:root[data-theme="dark"] .sb-link:hover,
:root[data-theme="dark"] .sb-link:focus-visible { background: rgba(255, 255, 255, 0.05); }

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .sidebar { background: var(--surface, #121c2e); border-right: 1px solid rgba(255,255,255,.07); }
  :root[data-theme="auto"] .topbar.client,
  :root[data-theme="auto"] .topbar.bare { background: var(--surface, #121c2e); border-bottom: 1px solid rgba(255,255,255,.07); }
  :root[data-theme="auto"] .appbar { background: var(--surface, #121c2e); border-bottom: 1px solid rgba(255,255,255,.07); }
  :root[data-theme="auto"] .sb-link.is-active { background: rgba(255,255,255,.05); box-shadow: inset 3px 0 0 var(--action); }
  :root[data-theme="auto"] .sb-link:hover,
  :root[data-theme="auto"] .sb-link:focus-visible { background: rgba(255,255,255,.05); }
}

/* ===========================================================================
   PREMIUM PASS v5 — Hero dezenter (beide Modi) + helle Sidebar/Topbar im Hellmodus
   =========================================================================== */

/* --- Hero ruhiger: weniger Glow, flacherer Verlauf --- */
.hero-band {
  background:
    radial-gradient(150% 170% at 92% -40%, rgba(240, 138, 75, 0.13), transparent 52%),
    linear-gradient(135deg, #142338, #1b3150);
  background-color: #15273e;
}
.hero-band::before { opacity: 0.5; }

/* --- HELLE Sidebar/Topbar (data-theme=light UND auto bei System hell) --- */
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .topbar.client,
:root[data-theme="light"] .topbar.bare,
:root[data-theme="light"] .appbar {
  background: #ffffff;
  color: var(--text);
}
:root[data-theme="light"] .sidebar { border-right: 1px solid var(--line); }
:root[data-theme="light"] .topbar.client,
:root[data-theme="light"] .topbar.bare,
:root[data-theme="light"] .appbar { border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .sb-brand { color: var(--text); border-bottom-color: var(--line); }
:root[data-theme="light"] .sb-brand-text strong,
:root[data-theme="light"] .topbar .brand,
:root[data-theme="light"] .topbar .brand-text strong,
:root[data-theme="light"] .appbar-title { color: var(--text); }
:root[data-theme="light"] .sb-brand-text small,
:root[data-theme="light"] .topbar .brand-text small { color: var(--muted); }
:root[data-theme="light"] .sb-link { color: #44505f; }
:root[data-theme="light"] .sb-link .ic { color: #6b7787; }
:root[data-theme="light"] .sb-link:hover,
:root[data-theme="light"] .sb-link:focus-visible { background: var(--surface-muted); color: var(--text); }
:root[data-theme="light"] .sb-link.is-active { background: var(--action-soft); color: var(--action); box-shadow: inset 3px 0 0 var(--action); }
:root[data-theme="light"] .sb-link.is-active .ic { color: var(--action); }
:root[data-theme="light"] .sb-foot { border-top-color: var(--line); }
:root[data-theme="light"] .sb-account-name { color: var(--text); }
:root[data-theme="light"] .sb-logout { color: var(--text); border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .sb-logout:hover { background: var(--surface-muted); }
:root[data-theme="light"] .sb-collapse,
:root[data-theme="light"] .appbar-bell,
:root[data-theme="light"] .nav-burger { color: #6b7787; border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .sb-collapse:hover { background: var(--surface-muted); color: var(--text); }
:root[data-theme="light"] .cmdk-open { background: var(--surface-muted); border-color: var(--line); color: var(--muted); }
:root[data-theme="light"] .cmdk-open:hover { background: #eef1f5; color: var(--text); }
:root[data-theme="light"] .sb-kbd { color: var(--muted); border-color: var(--line); }
:root[data-theme="light"] .theme-seg { border-color: var(--line); background: var(--surface-muted); }
:root[data-theme="light"] .theme-opt { color: var(--muted); }
:root[data-theme="light"] .theme-opt:hover { color: var(--text); }

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .sidebar,
  :root[data-theme="auto"] .topbar.client,
  :root[data-theme="auto"] .topbar.bare,
  :root[data-theme="auto"] .appbar { background: #ffffff; color: var(--text); }
  :root[data-theme="auto"] .sidebar { border-right: 1px solid var(--line); }
  :root[data-theme="auto"] .topbar.client,
  :root[data-theme="auto"] .topbar.bare,
  :root[data-theme="auto"] .appbar { border-bottom: 1px solid var(--line); }
  :root[data-theme="auto"] .sb-brand { color: var(--text); border-bottom-color: var(--line); }
  :root[data-theme="auto"] .sb-brand-text strong,
  :root[data-theme="auto"] .topbar .brand,
  :root[data-theme="auto"] .topbar .brand-text strong,
  :root[data-theme="auto"] .appbar-title { color: var(--text); }
  :root[data-theme="auto"] .sb-brand-text small,
  :root[data-theme="auto"] .topbar .brand-text small { color: var(--muted); }
  :root[data-theme="auto"] .sb-link { color: #44505f; }
  :root[data-theme="auto"] .sb-link .ic { color: #6b7787; }
  :root[data-theme="auto"] .sb-link:hover,
  :root[data-theme="auto"] .sb-link:focus-visible { background: var(--surface-muted); color: var(--text); }
  :root[data-theme="auto"] .sb-link.is-active { background: var(--action-soft); color: var(--action); box-shadow: inset 3px 0 0 var(--action); }
  :root[data-theme="auto"] .sb-link.is-active .ic { color: var(--action); }
  :root[data-theme="auto"] .sb-foot { border-top-color: var(--line); }
  :root[data-theme="auto"] .sb-account-name { color: var(--text); }
  :root[data-theme="auto"] .sb-logout { color: var(--text); border-color: var(--line); background: var(--surface); }
  :root[data-theme="auto"] .sb-logout:hover { background: var(--surface-muted); }
  :root[data-theme="auto"] .sb-collapse,
  :root[data-theme="auto"] .appbar-bell,
  :root[data-theme="auto"] .nav-burger { color: #6b7787; border-color: var(--line); background: var(--surface); }
  :root[data-theme="auto"] .sb-collapse:hover { background: var(--surface-muted); color: var(--text); }
  :root[data-theme="auto"] .cmdk-open { background: var(--surface-muted); border-color: var(--line); color: var(--muted); }
  :root[data-theme="auto"] .cmdk-open:hover { background: #eef1f5; color: var(--text); }
  :root[data-theme="auto"] .sb-kbd { color: var(--muted); border-color: var(--line); }
  :root[data-theme="auto"] .theme-seg { border-color: var(--line); background: var(--surface-muted); }
  :root[data-theme="auto"] .theme-opt { color: var(--muted); }
  :root[data-theme="auto"] .theme-opt:hover { color: var(--text); }
}

/* ===========================================================================
   PREMIUM PASS v6 — "De-Vibe": weg vom Marketing-Look, hin zum Werkzeug.
   Schlanker Seitenkopf statt Gradient-Hero, tighter Sans statt Display-Serif
   in der App, Haarlinien statt Schatten, mehr Dichte, weniger Radius-Pomp.
   Login/Marketing (shell-auth) behält den warmen Marken-Look (Fraunces).
   =========================================================================== */

/* 1) Hero-Band → schlanker Seitenkopf (kein Verlauf, keine Kachel) */
.shell-admin .hero-band,
.shell-client .hero-band {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0.1rem 0 1rem;
  margin-bottom: 0.2rem;
}
.shell-admin .hero-band::before,
.shell-client .hero-band::before { display: none; }
.shell-admin .hero-band, .shell-admin .hero-band h1, .shell-admin .hero-band p,
.shell-client .hero-band, .shell-client .hero-band h1, .shell-client .hero-band p { color: var(--text); }
.shell-admin .hero-band p, .shell-client .hero-band p { color: var(--muted); font-size: 0.95rem; }

/* 2) App-Typografie: tighter Sans statt Display-Serif (nur App, nicht Login) */
body.shell-admin h1, body.shell-client h1,
body.shell-admin h2, body.shell-client h2,
body.shell-admin h3, body.shell-client h3 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.018em;
}
body.shell-admin h1, body.shell-client h1 { font-weight: 680; font-size: clamp(1.35rem, 1.4rem + 0.8vw, 1.75rem); line-height: 1.15; }
body.shell-admin h2, body.shell-client h2 { font-weight: 660; font-size: 1.15rem; line-height: 1.2; }
body.shell-admin h3, body.shell-client h3 { font-weight: 640; font-size: 1rem; }

/* 3) Ruhige Flächen: Haarlinie statt Schatten, einheitlicher, kleinerer Radius */
.panel, .side-panel, .intro-card { box-shadow: none; border: 1px solid var(--line); border-radius: 14px; }
.stats > div, .project-card, .kanban-col, .task-card { box-shadow: none; border: 1px solid var(--line); border-radius: 12px; }
body.app .panel, body.app .project-card, body.app .side-panel, body.app .intro-card, body.app .kanban-col, body.app .task-card { border-radius: 14px; }
.project-card:hover { box-shadow: none; border-color: var(--line-strong); transform: none; }
.stats > div:hover { box-shadow: none; transform: none; border-color: var(--line-strong); }

/* 4) KPI-Karten dichter, Zahl klar aber nicht riesig */
.stats { gap: 0.7rem; }
.stats > div { padding: 0.85rem 0.95rem; gap: 0.15rem; }
.stats > div strong { font-size: 1.55rem; line-height: 1.1; }
.stats > div span:last-child { color: var(--muted); }
.stat-ctx { color: var(--muted); }

/* 5) Empty-States kompakter (weniger "großes Icon mitten im leeren Block") */
.empty-state { padding: 1.5rem 1rem; gap: 0.45rem; }
.empty-state .empty-ic { width: 42px; height: 42px; border-radius: 11px; }

/* 6) Eyebrow ruhiger (kein knalliges Dauer-Orange in Großbuchstaben überall) */
.eyebrow { color: var(--muted); font-weight: 700; letter-spacing: 0.1em; font-size: 0.7rem; }
.hero-band .eyebrow { color: var(--action); }

/* 7) Primärbutton flacher (kein glänzender Verlauf) */
.button { background: var(--action); box-shadow: none; border: 1px solid transparent; }
.button:hover { background: var(--action-hover); transform: none; filter: none; box-shadow: none; }
.button:active { transform: none; }

/* 8) Buttons im (jetzt hellen) Seitenkopf: solide statt "Glas" */
.quick-actions .button-secondary, .hero-band .button-secondary { background: var(--surface); }

/* v6b: Schnellzugriff als ruhige Listenlinks statt voller Buttons */
.quick-link-grid { display: grid; gap: 2px; margin-top: .6rem; }
.quick-link-grid .button, .quick-link-grid .button-secondary {
  justify-content: flex-start; background: transparent; border: 0; box-shadow: none;
  color: var(--text); font-weight: 560; padding: .58rem .7rem; border-radius: 8px;
}
.quick-link-grid .button:hover, .quick-link-grid .button-secondary:hover {
  background: var(--surface-muted); transform: none; color: var(--text);
}

/* v6c FIX: sekundaere Buttons duerfen nicht den Primaer-Hintergrund erben
   (.button.button-secondary = hoehere Spezifitaet, gewinnt in allen Themes) */
.button.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.button.button-secondary:hover { background: var(--surface-muted); color: var(--text); }
.quick-link-grid .button.button-secondary { background: transparent; border: 0; }
.quick-link-grid .button.button-secondary:hover { background: var(--surface-muted); }

/* ===========================================================================
   PREMIUM PASS v9 — Kundenbereich barrierearm & extrem intuitiv
   (für ältere / technikferne Nutzer): große Schrift, große Flächen, viel Ruhe,
   klare Aktionen, sichtbarer Fokus. ADMIN bleibt dicht/„Pro" (nicht betroffen).
   Schriftgröße über --cfz steuerbar (Schalter A / A+ / A++).
   =========================================================================== */
:root { --cfz: 17px; }
html[data-fz="gross"] { --cfz: 19.5px; }
html[data-fz="sehrgross"] { --cfz: 22px; }

/* Grund-Skalierung des Kundeninhalts (em-basiert → skaliert mit --cfz) */
body.shell-client .shell { font-size: var(--cfz); gap: 1.7rem; line-height: 1.55; }
body.shell-client .shell p,
body.shell-client .shell li,
body.shell-client .shell label,
body.shell-client .shell input,
body.shell-client .shell select,
body.shell-client .shell textarea,
body.shell-client .shell .button,
body.shell-client .shell a { font-size: 1em; }
body.shell-client .shell h1 { font-size: 1.7em; line-height: 1.2; }
body.shell-client .shell h2 { font-size: 1.32em; }
body.shell-client .shell h3 { font-size: 1.12em; }
body.shell-client .shell small,
body.shell-client .shell .muted { font-size: 0.9em; }
body.shell-client .shell .eyebrow { font-size: 0.78em; }

/* Große, klar abgegrenzte Aktionsflächen (Touch-Targets >= 52px) */
body.shell-client .shell .button { min-height: 52px; padding: 0.7em 1.4em; border-radius: 12px; font-weight: 650; }
body.shell-client .shell input,
body.shell-client .shell select,
body.shell-client .shell textarea { min-height: 50px; padding: 0.7em 0.9em; }
body.shell-client .shell textarea { min-height: 120px; }
body.shell-client .shell .wait-row,
body.shell-client .shell .file-row { padding: 1rem 1.1rem; }
body.shell-client .shell .panel { padding: clamp(1.15rem, 2.2vw, 1.7rem); }

/* Kunden-Sidebar etwas größer & ruhiger (eindeutige, große Ziele) */
body.shell-client .sb-link { font-size: 1.03rem; padding: 0.82rem 0.75rem; }
body.shell-client .sb-nav { gap: 4px; }

/* Kräftig sichtbarer Fokus im Kundenbereich */
body.shell-client a:focus-visible,
body.shell-client button:focus-visible,
body.shell-client input:focus-visible,
body.shell-client select:focus-visible,
body.shell-client textarea:focus-visible,
body.shell-client [tabindex]:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 6px; }

/* Schriftgrößen-Schalter (A / A+ / A++) */
.fz-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-muted); width: 100%; justify-content: space-between; margin-top: .4rem; }
.fz-opt { flex: 1; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); border-radius: 999px; cursor: pointer; font-weight: 700; line-height: 1; padding: .4rem; }
.fz-opt[data-fz-set="normal"] { font-size: .8rem; }
.fz-opt[data-fz-set="gross"] { font-size: .95rem; }
.fz-opt[data-fz-set="sehrgross"] { font-size: 1.12rem; }
.fz-opt:hover { color: var(--text); }
html[data-fz="gross"] .fz-opt[data-fz-set="gross"],
html[data-fz="sehrgross"] .fz-opt[data-fz-set="sehrgross"],
html:not([data-fz]) .fz-opt[data-fz-set="normal"],
html[data-fz="normal"] .fz-opt[data-fz-set="normal"] { background: var(--action); color: #fff; }
.sb-fontsize { padding: .4rem .15rem .1rem; }
.sb-fontsize .fz-label { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; padding: 0 .15rem .1rem; }
html[data-sidebar="collapsed"] .sb-fontsize { display: none; }

/* FIX: [hidden] muss display-Regeln schlagen (sonst zeigen sich versteckte
   Empty-States / leere Badge-Zaehler trotz hidden-Attribut). */
[hidden] { display: none !important; }

/* ===========================================================================
   PREMIUM PASS v11 — Kundenbereich entkacheln: Inhalts-Sektionen statt
   gestapelter harter Karten. Top-Level-Panels werden zu ruhigen Sektionen,
   per Haarlinie getrennt (wie Stripe/Linear-Einstellungen). Projektkarten
   (.project-grid) und Seiten-Karten (.side-panel, z.B. Ansprechpartner)
   bleiben bewusst Karten.
   =========================================================================== */
body.shell-client .shell > .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--line);
  padding: 1.7rem 0 0.2rem;
}
body.shell-client .shell > .panel:first-of-type,
body.shell-client .shell > .hero-band + .panel { /* erste Sektion nach dem Kopf ohne Doppellinie */ }
/* Listen/Inhalte in den Sektionen bekommen mehr Luft */
body.shell-client .shell > .panel > .file-list,
body.shell-client .shell > .panel > .wait-list,
body.shell-client .shell > .panel > .timeline { margin-top: 0.4rem; }
/* Innerhalb echter Karten (Projektkarten, Ansprechpartner) NICHTS ändern */

/* ===========================================================================
   PREMIUM PASS v12 — echte Timeline statt Kästchen: Verlauf/Updates als
   verbundene Ereignis-Liste (kein Karten-Look pro Eintrag).
   =========================================================================== */
.timeline-body { background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0 0 0.2rem; }
.timeline li { position: relative; }
.timeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 9px; top: 1.5rem; bottom: -0.85rem; width: 2px;
  background: var(--line);
}
.timeline-dot { z-index: 1; }

/* ===========================================================================
   PREMIUM PASS v13 — Admin entkacheln (gleiches Sektions-Prinzip wie Kunde).
   Top-Level-Inhaltspanels werden zu ruhigen Sektionen mit Haarlinie.
   KPI-Karten (.stats>div), Kanban-Spalten (.kanban-col), Tabellen (.table-wrap)
   und Seiten-Karten (.side-panel) bleiben bewusst abgegrenzt.
   =========================================================================== */
body.shell-admin .app-main .shell > .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 0.2rem;
}
body.shell-admin .app-main .shell > .hero-band + .panel { border-top: 0; padding-top: 0.4rem; }
/* Panels, die NUR eine Tabelle enthalten: Tabelle trägt schon die Abgrenzung */
body.shell-admin .app-main .shell > .panel > .table-wrap { margin-top: 0.6rem; }

/* Rechnungs-Status-Badge */
.pay-badge { display: inline-block; padding: .08em .5em; border-radius: 999px; font-size: .72em; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.pay-badge.is-paid { background: var(--forest-soft, rgba(45,90,61,.14)); color: var(--forest, #2d5a3d); }
.pay-badge.is-open { background: var(--amber-soft, rgba(200,116,48,.16)); color: #9a5a16; }
:root[data-theme="dark"] .pay-badge.is-paid { color: #6fcf97; }
:root[data-theme="dark"] .pay-badge.is-open { color: #f0b072; }

/* v15: Aufgaben-Formular mit sichtbaren Labels */
.task-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; }
.ta-field { display: grid; gap: .25rem; }
.ta-field > span { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ta-grow { flex: 1 1 240px; }
.ta-check { display: inline-flex; align-items: center; gap: .45rem; align-self: center; padding-top: 1.1rem; }
.ta-check input { width: 18px; height: 18px; }

/* ===========================================================================
   PREMIUM PASS v16 — Nachrichten/Chat neu aufgesetzt: Bubbles wachsen mit dem
   Inhalt (keine starre Mindestbreite mehr), aufeinanderfolgende Nachrichten
   desselben Absenders werden gruppiert (Name einmal pro Gruppe, „Schwanz" nur
   an der letzten), Tages-Trenner + Inline-Uhrzeit, scrollbarer Verlauf, ruhiger
   Auto-Grow-Composer. Vorbild: Nextcloud Talk / moderne Messenger.
   =========================================================================== */
.chat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(58vh, 540px);
  overflow-y: auto;
  padding: .25rem .35rem .25rem .1rem;
  margin: .2rem 0 .9rem;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.chat-day { display: flex; align-items: center; justify-content: center; margin: .9rem 0 .5rem; }
.chat-day:first-child { margin-top: .2rem; }
.chat-day span {
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: var(--muted);
  background: var(--surface-muted); border: 1px solid var(--line);
  padding: .16rem .65rem; border-radius: 999px;
}
.chat-msg {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: min(68ch, 76%);
  min-width: 0;
  padding: .5rem .8rem .42rem;
  border-radius: 16px;
  line-height: 1.5;
  box-shadow: none;
  overflow-wrap: anywhere;
}
.chat-msg.is-first { margin-top: .7rem; }
.chat-day + .chat-msg { margin-top: 0; }
.chat-text { white-space: normal; }
.chat-in { align-self: flex-start; background: var(--surface-muted); border: 1px solid var(--line); color: var(--text); border-top-left-radius: 6px; }
.chat-out { align-self: flex-end; background: var(--navy, #162840); color: #fff; border: 1px solid transparent; border-top-right-radius: 6px; }
.chat-in.is-cont { border-top-left-radius: 16px; }
.chat-out.is-cont { border-top-right-radius: 16px; }
.chat-in.is-last { border-bottom-left-radius: 6px; }
.chat-out.is-last { border-bottom-right-radius: 6px; }
:root[data-theme="dark"] .chat-in { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); }
:root[data-theme="dark"] .chat-out { background: #24405f; }
.chat-author { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 0 0 .12rem .05rem; }
.chat-out .chat-author { text-align: right; color: rgba(255,255,255,.72); }
.chat-time { align-self: flex-end; font-size: .62rem; font-variant-numeric: tabular-nums; opacity: .55; margin-top: .12rem; }
.chat-out .chat-time { color: rgba(255,255,255,.75); opacity: .9; }
@media (max-width: 640px) { .chat-msg { max-width: 86%; } .chat { max-height: 62vh; } }

/* Composer – ruhiger Eingabebereich, kompakter rechtsbündiger Senden-Button
   (kein vollbreiter Signalbutton – wirkt wie ein echtes Messenger-Eingabefeld). */
.message-form { display: flex; flex-direction: column; gap: .55rem; }
.message-form > label { margin: 0; }
.message-form > label > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.message-form textarea { resize: none; min-height: 2.8rem; max-height: 11rem; overflow-y: auto; line-height: 1.5; }
.message-form > button[type="submit"] { align-self: flex-end; width: auto; }

/* Darstellung (Mein Konto / Einstellungen → Farbmodus & Schriftgröße) */
.appearance-grid { display: flex; flex-direction: column; gap: 0; margin-top: .4rem; }
.appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.4rem; flex-wrap: wrap; padding: .85rem 0; border-top: 1px solid var(--line); }
.appearance-grid .appearance-row:first-child { border-top: 0; }
.appearance-label strong { display: block; font-size: .95rem; }
.appearance-label small { display: block; }
.appearance-row .theme-seg, .appearance-row .fz-seg { width: auto; flex: 0 0 auto; margin-top: 0; }
.appearance-row .fz-seg { min-width: 160px; }

/* ===========================================================================
   PREMIUM PASS v17 — Tagesgeschäft-Ausbau: Filter-Chips, Anfragen-Liste,
   kleine Buttons, Zeit-Auswertung. Ruhig, Haarlinien, klare Hierarchie.
   =========================================================================== */
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.3rem 0 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .36rem .72rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 600; text-decoration: none; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.chip:hover { border-color: var(--action); }
.chip.is-active { background: var(--action); color: #fff; border-color: var(--action); }
.chip span { font-size: .72rem; opacity: .75; font-variant-numeric: tabular-nums; }
.chip.is-active span { opacity: .9; }

.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.req-row { display: flex; gap: 1.1rem; align-items: flex-start; justify-content: space-between; padding: 1rem 0; border-top: 1px solid var(--line); }
.req-list .req-row:first-child { border-top: 0; }
.req-main { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.req-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.req-text { margin-top: .35rem; color: var(--text); white-space: normal; max-width: 70ch; }
.req-urgent { font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #d6492f; padding: .1rem .42rem; border-radius: 6px; line-height: 1.4; }
.req-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex: 0 0 auto; }
.req-status-form { margin: 0; }
.req-status-form select { padding: .34rem .55rem; min-width: 9rem; }
.req-buttons { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.button.button-sm { padding: .42rem .72rem; font-size: .8rem; }
@media (max-width: 640px) {
  .req-row { flex-direction: column; }
  .req-actions { align-items: stretch; }
  .req-buttons { justify-content: flex-start; }
}

/* Zeit-Auswertung (admin/zeiten.php) */
.time-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin: .2rem 0 .4rem; }
.time-total strong { font-size: 1.6rem; letter-spacing: -.02em; }

/* Datei-Versionen + schnelle Freigaben (projekt.php) */
.file-item { padding: .15rem 0; }
.file-line { display: flex; align-items: center; gap: .4rem; }
.file-line .file-row { flex: 1; min-width: 0; }
.file-del-form { margin: 0; flex: 0 0 auto; }
.ver-badge { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .02em; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; vertical-align: middle; }
.file-approve { margin: .35rem 0 .2rem 2.1rem; }
.file-decide { margin: .4rem 0 .3rem 2.1rem; display: flex; flex-direction: column; gap: .4rem; }
.file-decide textarea { width: 100%; resize: vertical; min-height: 2.4rem; }
.file-decide-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.file-comment { margin: .3rem 0 .2rem 2.1rem; color: var(--muted); display: flex; gap: .35rem; align-items: flex-start; }
.file-versions { margin: .25rem 0 .1rem 2.1rem; }
.file-versions > summary { cursor: pointer; font-size: .8rem; color: var(--muted); font-weight: 600; }
.file-versions > summary:hover { color: var(--action); }
.file-list-sub { list-style: none; margin: .3rem 0 0; padding: 0; }
.file-row.sub { opacity: .82; }
@media (max-width: 640px) {
  .file-approve, .file-decide, .file-comment, .file-versions { margin-left: 0; }
}

/* ===========================================================================
   PREMIUM PASS v18 — Navigation gruppiert (IA: Arbeit/Kunden/Verwaltung),
   Ticket-System (Priorität/Typ/Assignee/Thread). Klare Sektionen statt
   einer flachen 12er-Liste.
   =========================================================================== */
.sb-group-label { margin: 0; padding: .9rem .95rem .25rem; font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sb-nav > .sb-group-label:first-of-type { padding-top: .6rem; }
.sb-group-sep { display: block; height: 1px; background: var(--line); margin: .55rem .85rem; }
/* Eingeklappte Leiste (Icon-Rail): Gruppen-Überschrift → schmale Trennlinie */
html[data-sidebar="collapsed"] .sb-group-label { height: 0; padding: .5rem 0 0; overflow: hidden; }
html[data-sidebar="collapsed"] .sb-group-label::before { content: ""; display: block; height: 1px; background: var(--line); margin: 0 .55rem; }
html[data-sidebar="collapsed"] .sb-group-sep { margin: .4rem .55rem; }

/* Ticket-System */
.prio-dot { display: inline-block; width: .58rem; height: .58rem; border-radius: 50%; flex: 0 0 auto; }
.prio-dringend { background: #d6492f; }
.prio-hoch { background: #e8883a; }
.prio-normal { background: #6b87a8; }
.prio-niedrig { background: var(--line); border: 1px solid var(--muted); }
.prio-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; color: var(--muted); }
.type-badge { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: .04rem .34rem; }
.ticket-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem 1.1rem; margin: .2rem 0 .6rem; }
.ticket-meta-grid .tm { display: flex; flex-direction: column; gap: .25rem; }
.ticket-meta-grid .tm > span { font-size: .7rem; color: var(--muted); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.ticket-meta-grid select, .ticket-meta-grid input { padding: .38rem .5rem; }
.ticket-actions-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .2rem 0 .4rem; }
.tcomment { display: flex; flex-direction: column; gap: .15rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.tcomment:first-child { border-top: 0; }
.tcomment.is-intern { background: var(--surface-muted); border-radius: 10px; padding: .7rem .8rem; border: 1px dashed var(--line); margin: .35rem 0; }
.tcomment-head { display: flex; align-items: center; gap: .5rem; font-size: .76rem; }
.tcomment-head strong { font-weight: 700; }
.tcomment-head .intern-tag { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #b06a1f; }
.tcomment-body { color: var(--text); white-space: normal; }
.due-flag { font-size: .72rem; font-weight: 700; }
.due-flag.overdue { color: #d6492f; }
.due-flag.today { color: #c9761c; }
/* Kompakte Formular-CTAs links statt vollbreit (Grid-Formulare) – kein Vibecoding-Signalbalken. */
.form > .button-sm { justify-self: start; }

/* ===========================================================================
   ENTERPRISE PASS v19 — Farb-Budget & Form-Sprache (Linear/Stripe/Vercel).
   Kernidee aus der Recherche: weniger Farben (≈5 statt ≈11), EINE Akzentfarbe
   sparsam, dezente Active-States, ruhige Form. Behebt die letzten „AI-Look"-
   Signale: bunte Avatare, orange Aktiv-Pille, Pill-Buttons mit Glow, orange
   Eyebrows überall, over-bold Text, Marketing-Hero-Köpfe.
   =========================================================================== */

/* 1) Avatare monochrom (eine Marke-Tonalität statt Regenbogen-Hues). */
.avatar { background: #25344a !important; color: #fff !important; font-weight: 600; }
:root[data-theme="dark"] .avatar { background: #33465f !important; }

/* 2) Eyebrows ruhig (muted statt Orange) – nimmt sehr viel Akzentfarbe raus. */
.eyebrow { color: var(--muted) !important; font-weight: 700; font-size: .68rem; letter-spacing: .06em; }

/* 3) Buttons: moderater Radius, flach (kein Orange-Glow), ruhigeres Gewicht. */
.button { border-radius: 10px !important; box-shadow: none !important; font-weight: 600; }
.button:active { transform: translateY(0.5px); }
.button-secondary { font-weight: 600; }

/* 4) Aktiver Menüpunkt dezent: neutrale Fläche + schmaler Akzentbalken + Akzent-Icon,
      Text NICHT orange (Linear/Stripe-Prinzip). */
body.shell-admin .sb-link.is-active,
body.shell-client .sb-link.is-active,
:root[data-theme="light"] .sb-link.is-active,
:root[data-theme="dark"] .sb-link.is-active {
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--action) !important;
}
:root[data-theme="dark"] .sb-link.is-active { background: rgba(255,255,255,.055) !important; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .sb-link.is-active { background: rgba(255,255,255,.055) !important; color: #fff !important; box-shadow: inset 2px 0 0 var(--action) !important; } }
.sb-link.is-active .ic { color: var(--action) !important; }

/* 5) Seitenkopf kompakter (Werkzeug, kein Marketing-Banner). */
body.shell-admin .hero-band, body.shell-client .hero-band { margin-bottom: 1rem; padding-bottom: .2rem; }
body.shell-admin .hero-band h1, body.shell-client .hero-band h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.01em; }
body.shell-admin .hero-band > div > p, body.shell-client .hero-band > div > p { font-size: .9rem; color: var(--muted); margin-top: .35rem; }

/* 6) Etwas weniger Fettschrift insgesamt (over-bold ist ein AI-Tell). */
.sb-link { font-weight: 550; }
.notice { font-weight: 600; }
.badge { font-weight: 650; }

/* 7) Sekundärlinks/Trust-Linien ohne Pill-Optik im App-Kontext. */
body.shell-client .trust-line { border-radius: 10px; }

/* 8) KPI-Zahlen neutral (Akzentfarbe nur für Deltas/Status, nicht für jede Kennzahl). */
.stats strong, .stats-wide strong, .time-total strong { color: var(--text) !important; }
.stat-ctx.stat-up { color: #2d7a52; }
/* 9) Karten ruhiger: einheitliche Haarlinie, kein bunter Rand. */
.stats > div, .stats-wide > div { border-radius: 12px; }

/* Hilfe / FAQ */
.help-steps { margin: .3rem 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.help-steps li { line-height: 1.55; }
.help-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin-top: .4rem; }
.help-matrix > div { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .25rem; }
.help-matrix strong { font-size: .95rem; }
.help-matrix span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.faq-item { border-top: 1px solid var(--line); padding: .2rem 0; }
.faq-item:first-of-type { border-top: 0; }
.faq-item > summary { cursor: pointer; list-style: none; padding: .85rem .2rem; font-weight: 650; display: flex; align-items: center; gap: .5rem; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: "+"; color: var(--action); font-weight: 700; width: 1rem; display: inline-block; }
.faq-item[open] > summary::before { content: "–"; }
.faq-item > p { margin: 0 0 .8rem 1.5rem; color: var(--text); line-height: 1.6; max-width: 75ch; }
.faq-item > p + p { margin-top: -.3rem; }

/* ===========================================================================
   PASS v21 — Scrollbare Seitenleiste + Mobile-Feinschliff (Team mobil arbeiten,
   als PWA installierbar). Navigation scrollt unabhängig; Kopf/Fuß bleiben.
   =========================================================================== */
.sidebar { overflow: hidden; }
.sb-head, .sb-foot { flex: 0 0 auto; }
.sb-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; }
.sb-nav::-webkit-scrollbar { width: 7px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }
:root[data-theme="light"] .sb-nav::-webkit-scrollbar-thumb { background: rgba(22,40,64,.18); }

/* Tabellen horizontal scrollbar statt geclippt (Mobile). */
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
  /* Im mobilen Top-Dropdown scrollt die ganze Leiste als Einheit. */
  .sb-nav { overflow: visible; min-height: auto; flex: 0 0 auto; }
}

/* Mobile-Feinschliff Team-Ansichten (≤640px). */
@media (max-width: 640px) {
  /* Seitenkopf stapelt: Titel über Aktionen, Buttons greifbar. */
  .hero-band { flex-direction: column; align-items: stretch; }
  .hero-band .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
  .hero-band .actions .button { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  /* Ticket-Detail: Seitenpanel unter den Inhalt. */
  .content-grid { grid-template-columns: 1fr; }
  /* Kennzahlen 2-spaltig statt gequetscht. */
  .stats, .stats-wide { grid-template-columns: 1fr 1fr !important; }
  /* Ticket-Zeile: Status/Assignee unter den Titel. */
  .req-row.admin { flex-direction: column; }
  .req-row.admin .req-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: .5rem 1rem; }
  /* Touch-Targets in Tabellen-Aktionen. */
  .row-actions .icon-btn { min-width: 38px; min-height: 38px; }
}

/* Kanban auf Mobile horizontal scrollbar (statt 4 lange Stapel). */
@media (max-width: 540px) {
  .kanban { display: flex; overflow-x: auto; gap: .7rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: .3rem; }
  .kanban-col { min-width: 78vw; scroll-snap-align: start; }
}
