/* ==========================================================================
   Complianswer – Design-Schicht
   Wird nach allen anderen Stylesheets geladen. Enthält Design-Tokens,
   Mikroanimationen, Skeleton-Zustände und den visuellen Feinschliff.
   ========================================================================== */

:root {
    /* Farbe */
    --c-brand-50: #eef7f3;
    --c-brand-100: #dcefe6;
    --c-brand-200: #b9dfcf;
    --c-brand-400: #3aa48f;
    --c-brand-500: #0f8a7a;
    --c-brand-600: #0a7568;
    --c-brand-700: #075f55;
    --c-ink: #14272a;
    --c-ink-2: #3c524d;
    --c-muted: #6f817a;
    --c-subtle: #93a39c;
    --c-line: #e3eae6;
    --c-line-strong: #d3ddd7;
    --c-surface: #ffffff;
    --c-canvas: #f4f7f5;
    --c-warn: #b4632b;
    --c-warn-bg: #fff4ea;
    --c-danger: #a93d3d;
    --c-danger-bg: #fff1ef;

    /* Form */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;

    /* Tiefe – mehrlagige, sehr weiche Schatten */
    --sh-xs: 0 1px 2px rgb(16 40 35 / .04);
    --sh-sm: 0 1px 2px rgb(16 40 35 / .04), 0 2px 8px -2px rgb(16 40 35 / .05);
    --sh-md: 0 1px 2px rgb(16 40 35 / .04), 0 8px 24px -8px rgb(16 40 35 / .10);
    --sh-lg: 0 2px 4px rgb(16 40 35 / .04), 0 18px 40px -14px rgb(16 40 35 / .18);
    --sh-brand: 0 1px 1px rgb(7 95 85 / .18), 0 6px 16px -6px rgb(10 117 104 / .45);
    --ring: 0 0 0 4px rgb(15 138 122 / .16);

    /* Bewegung */
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --t-fast: 140ms;
    --t-base: 220ms;
    --t-slow: 420ms;

    --font-sans: "Inter", "InterVariable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;

    font-family: var(--font-sans);
    color: var(--c-ink);
    background: var(--c-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01", "ss03";
    accent-color: var(--c-brand-500);
}

::selection { background: var(--c-brand-200); color: var(--c-ink); }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

/* ---------- Icons ---------- */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex-shrink: 0; }

/* ---------- Typografie ---------- */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.workspace-shell h1, .onboarding-shell h1 { letter-spacing: -.035em; font-weight: 680; }
.workspace-shell .eyebrow, .onboarding-shell .eyebrow, .auth-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 10px; letter-spacing: .16em; color: var(--c-brand-600);
}
.workspace-shell .eyebrow::before, .onboarding-shell .onboarding-body .eyebrow::before {
    content: ""; width: 14px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--c-brand-500), var(--c-brand-400));
}
.stat-grid strong, .count-pill, .task-progress span, .setup-progress { font-variant-numeric: tabular-nums; }

/* ---------- Links ---------- */
a { color: var(--c-brand-600); transition: color var(--t-fast) ease; }
a:hover { color: var(--c-brand-700); text-decoration: none; }
main p a:not(.button):not(.inline-action), .task-footnote a {
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size var(--t-base) var(--ease-out), color var(--t-fast);
}
main p a:not(.button):not(.inline-action):hover { background-size: 100% 1px; }

/* Pfeile in Links bekommen einen kleinen Schubs */
.inline-action, .cards a, .document-actions a, .overview-message-actions a, .breadcrumb {
    transition: color var(--t-fast), gap var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.inline-action:hover > span[aria-hidden] { transform: translateX(3px); }
.inline-action > span[aria-hidden] { display: inline-block; transition: transform var(--t-base) var(--ease-out); }
.breadcrumb:hover { transform: translateX(-2px); }

/* ---------- Fokus ---------- */
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--c-brand-500) !important;
    outline-offset: 2px !important;
    box-shadow: var(--ring);
}
input:focus, select:focus, textarea:focus { outline: none !important; }

/* ---------- Buttons ---------- */
button, .button {
    position: relative;
    isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--r-sm);
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out),
                background-color var(--t-base), border-color var(--t-base), color var(--t-fast), filter var(--t-base);
    -webkit-tap-highlight-color: transparent;
}
.workspace-shell button:not(.text-button):not(.auth-language button):not(.secondary),
.workspace-shell .button:not(.secondary),
.onboarding-shell button:not(.auth-language button):not(.text-button),
.auth-main .auth-submit {
    background: linear-gradient(180deg, #13998a 0%, var(--c-brand-600) 100%);
    border: 1px solid var(--c-brand-700);
    color: #fff;
    box-shadow: var(--sh-brand), inset 0 1px 0 rgb(255 255 255 / .18);
    overflow: hidden;
    font-weight: 600;
    letter-spacing: .005em;
}
/* Glanz-Sweep beim Hover */
.workspace-shell button:not(.text-button):not(.auth-language button):not(.secondary)::after,
.workspace-shell .button:not(.secondary)::after,
.onboarding-shell button:not(.auth-language button):not(.text-button)::after,
.auth-main .auth-submit::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .22) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 700ms var(--ease-out);
}
.workspace-shell button:not(.text-button):not(.auth-language button):not(.secondary):hover,
.workspace-shell .button:not(.secondary):hover,
.onboarding-shell button:not(.auth-language button):not(.text-button):hover,
.auth-main .auth-submit:hover {
    background: linear-gradient(180deg, #11a090 0%, #0a7d70 100%);
    transform: translateY(-1px);
    box-shadow: 0 1px 1px rgb(7 95 85 / .2), 0 10px 22px -8px rgb(10 117 104 / .55), inset 0 1px 0 rgb(255 255 255 / .2);
    color: #fff;
}
.workspace-shell button:not(.text-button):not(.auth-language button):not(.secondary):hover::after,
.workspace-shell .button:not(.secondary):hover::after,
.onboarding-shell button:not(.auth-language button):not(.text-button):hover::after,
.auth-main .auth-submit:hover::after { transform: translateX(120%); }

button:active, .button:active { transform: translateY(0) scale(.975) !important; transition-duration: 60ms; }

.workspace-shell button.secondary, .workspace-shell .button.secondary, .auth-main .auth-passkey {
    background: var(--c-surface) !important;
    color: var(--c-ink-2) !important;
    border: 1px solid var(--c-line-strong) !important;
    box-shadow: var(--sh-xs) !important;
}
.workspace-shell button.secondary:hover, .workspace-shell .button.secondary:hover, .auth-main .auth-passkey:hover {
    background: var(--c-brand-50) !important;
    border-color: var(--c-brand-200) !important;
    color: var(--c-brand-700) !important;
    transform: translateY(-1px);
}
.text-button {
    border-radius: 6px; font-weight: 600;
    transition: background-color var(--t-fast), color var(--t-fast);
}
.text-button:hover { background: var(--c-brand-50) !important; color: var(--c-brand-700) !important; }
.logout-button { display: inline-flex !important; align-items: center; gap: 7px; padding: 7px 10px !important; color: var(--c-muted) !important; }
.logout-button .icon { font-size: 15px; transition: transform var(--t-base) var(--ease-out); }
.logout-button:hover .icon { transform: translateX(2px); }

/* Lade-Zustand bei Formular-Absendung */
button.is-loading { color: transparent !important; pointer-events: none; }
button.is-loading::before {
    content: ""; position: absolute; inset: 0; margin: auto; z-index: 1;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff;
    animation: cs-spin .7s linear infinite;
}
button.secondary.is-loading::before, .text-button.is-loading::before, .auth-language button.is-loading::before {
    border-color: rgb(15 138 122 / .2); border-top-color: var(--c-brand-500);
}
@keyframes cs-spin { to { transform: rotate(360deg); } }

/* ---------- Formulare ---------- */
input:not([type=checkbox]):not([type=hidden]):not([type=file]), select, textarea {
    transition: border-color var(--t-fast), box-shadow var(--t-base) var(--ease-out), background-color var(--t-fast);
    background-color: var(--c-surface);
}
input:not([type=checkbox]):not([type=hidden]):not([type=file]):hover, select:hover, textarea:hover { border-color: #b8c8bf !important; }
input:not([type=checkbox]):not([type=hidden]):not([type=file]):focus, select:focus, textarea:focus {
    border-color: var(--c-brand-500) !important;
    box-shadow: var(--ring), var(--sh-xs) !important;
}
select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f817a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    padding-right: 38px !important;
}
.invalid { box-shadow: 0 0 0 4px rgb(169 61 61 / .1) !important; animation: cs-shake .32s var(--ease-out); }
.validation-message { font-size: 12px; margin-top: 6px; animation: cs-rise .25s var(--ease-out) both; }
@keyframes cs-shake { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
input[type=checkbox] { accent-color: var(--c-brand-500); transition: transform var(--t-fast) var(--ease-spring); }
input[type=checkbox]:active { transform: scale(.88); }

/* ---------- Shell & Seitenleiste ---------- */
.workspace-shell { background: radial-gradient(1200px 600px at 85% -10%, rgb(205 233 220 / .55), transparent 60%), var(--c-canvas); }
.workspace-shell .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
    border-right: 1px solid var(--c-line);
    overflow-x: hidden; overflow-y: auto;
}
.brand { color: var(--c-ink) !important; transition: opacity var(--t-fast); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-grid !important; place-items: center;
    width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(145deg, #17a593, var(--c-brand-700));
    color: #fff !important; font-size: 18px !important;
    box-shadow: var(--sh-brand), inset 0 1px 0 rgb(255 255 255 / .25);
    transition: transform var(--t-slow) var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-mark .icon { width: 18px; height: 18px; }

.workspace-identity {
    background: linear-gradient(160deg, #ffffff, var(--c-brand-50)) !important;
    border-color: var(--c-line) !important;
    box-shadow: var(--sh-xs);
}
.identity-icon {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--c-brand-100); color: var(--c-brand-600) !important; font-size: 18px !important;
}

.workspace-shell .sidebar nav a {
    position: relative;
    color: var(--c-ink-2);
    border-radius: 10px;
    transition: background-color var(--t-base), color var(--t-fast), padding-left var(--t-base) var(--ease-out);
}
.workspace-shell .sidebar nav a .icon { font-size: 18px; color: var(--c-subtle); transition: color var(--t-fast), transform var(--t-base) var(--ease-spring); }
.workspace-shell .sidebar nav a:hover { background: #f1f6f3; text-decoration: none; color: var(--c-ink); }
.workspace-shell .sidebar nav a:hover .icon { color: var(--c-brand-500); transform: scale(1.08); }
.workspace-shell .sidebar nav a::before {
    content: ""; position: absolute; left: 3px; top: 50%; width: 3px; height: 18px;
    border-radius: 3px; background: var(--c-brand-500);
    transform: translateY(-50%) scaleY(0); transform-origin: center;
    transition: transform var(--t-base) var(--ease-spring);
}
.workspace-shell .sidebar nav a.active {
    background: linear-gradient(100deg, var(--c-brand-100), var(--c-brand-50)) !important;
    color: var(--c-brand-700) !important;
    box-shadow: inset 0 0 0 1px rgb(15 138 122 / .08);
}
.workspace-shell .sidebar nav a.active::before { transform: translateY(-50%) scaleY(1); }
.workspace-shell .sidebar nav a.active .icon { color: var(--c-brand-600); }

.pilot-dot { position: relative; background: #22b39b !important; }
.pilot-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
    animation: cs-ping 2.4s var(--ease-out) infinite;
}
@keyframes cs-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3); opacity: 0; } }

/* Topbar: klebend, gläsern */
.workspace-topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgb(255 255 255 / .72) !important;
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid rgb(211 221 215 / .7) !important;
}

/* ---------- Flächen ---------- */
.workspace-shell .panel, .workspace-shell .cards article, .onboarding-body, .onboarding-rail, .invitation-card {
    border: 1px solid var(--c-line) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--sh-sm) !important;
    background-color: var(--c-surface);
}
.workspace-shell .cards article, .customer-modules article, .stat-grid article {
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.workspace-shell .cards article:hover, .customer-modules article:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-lg) !important;
    border-color: var(--c-brand-200) !important;
}
.workspace-shell .cards article:hover .office-card-icon { transform: scale(1.06) rotate(-4deg); }
.workspace-shell .create-office-card { background: repeating-linear-gradient(135deg, #fbfdfc 0 10px, #f6faf8 10px 20px) !important; border-style: dashed !important; box-shadow: none !important; }
.workspace-shell .create-office-card:hover { border-color: var(--c-brand-400) !important; }

/* Kennzahlen */
.stat-grid article {
    position: relative; overflow: hidden;
    border-color: var(--c-line) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--sh-sm);
}

.stat-grid article:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.stat-grid article strong { color: var(--c-ink); letter-spacing: -.03em; }
.stat-grid article a { color: var(--c-muted); }
.stat-grid article a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.stat-grid article:has(a):hover { border-color: var(--c-brand-200) !important; }
.stat-grid article:has(a):hover a { color: var(--c-brand-700); }

.stat-icon, .office-card-icon, .section-kicker, .welcome-symbol, .document-icon, .help-symbol {
    background: linear-gradient(145deg, var(--c-brand-50), var(--c-brand-100)) !important;
    color: var(--c-brand-600) !important;
    box-shadow: inset 0 0 0 1px rgb(15 138 122 / .08);
    transition: transform var(--t-base) var(--ease-spring);
}
.stat-icon { font-size: 21px !important; }
.section-kicker { font-size: 18px !important; }
.office-card-icon { font-size: 22px !important; }
.welcome-symbol { font-size: 24px !important; }
.document-icon { font-size: 20px !important; }
.help-symbol { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-size: 22px !important; background: rgb(255 255 255 / .7) !important; }
.auth-context-icon { display: inline-grid; place-items: center; font-size: 18px !important; }
.overview-stats article:nth-child(3) .stat-icon { background: linear-gradient(145deg, #fff6ee, #ffe8d6) !important; color: var(--c-warn) !important; }

/* ---------- Badges & Pillen ---------- */
.workspace-shell .badge, .badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px !important; border-radius: 999px !important;
    font-weight: 600; letter-spacing: .01em;
    background: var(--c-brand-50); color: var(--c-brand-700);
    box-shadow: inset 0 0 0 1px rgb(15 138 122 / .12);
}
.workspace-shell .badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75;
}
.workspace-shell .muted-badge { background: #f2f4f2 !important; color: #7b8a83 !important; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .05); }
.workspace-shell .overview-overdue, .overview-overdue { background: var(--c-warn-bg) !important; color: var(--c-warn) !important; box-shadow: inset 0 0 0 1px rgb(180 99 43 / .18); }
.workspace-shell .overview-overdue::before { animation: cs-pulse-dot 1.8s ease-in-out infinite; }
@keyframes cs-pulse-dot { 50% { opacity: .25; } }
.access-active::before { display: none !important; }
.count-pill { background: var(--c-brand-50) !important; color: var(--c-brand-700) !important; font-weight: 650; box-shadow: inset 0 0 0 1px rgb(15 138 122 / .1); }

/* Filter-Pillen */
.overview-filters { padding: 4px; background: #f1f5f3; border-radius: 999px; display: inline-flex !important; box-shadow: inset 0 1px 2px rgb(16 40 35 / .05); }
.overview-filters a {
    background: transparent !important; color: var(--c-muted) !important; font-weight: 550;
    transition: background-color var(--t-base) var(--ease-out), color var(--t-fast), box-shadow var(--t-base);
}
.overview-filters a:hover { color: var(--c-ink) !important; background: rgb(255 255 255 / .6) !important; }
.overview-filters .selected { background: var(--c-surface) !important; color: var(--c-brand-700) !important; box-shadow: var(--sh-sm); }

/* ---------- Tabellen & Listen ---------- */
.workspace-shell th { text-transform: uppercase; letter-spacing: .08em; font-weight: 600 !important; }
.workspace-shell th:first-child { border-top-left-radius: 10px; }
.workspace-shell th:last-child { border-top-right-radius: 10px; }
.workspace-shell tbody tr { transition: background-color var(--t-fast); }
.workspace-shell tbody tr:hover { background: #f7faf8; }
.workspace-shell tbody tr:hover .org-avatar { transform: scale(1.08); background: var(--c-brand-100); color: var(--c-brand-700); }
.workspace-shell tbody tr td:last-child a { display: inline-block; transition: transform var(--t-base) var(--ease-out); }
.workspace-shell tbody tr:hover td:last-child a { transform: translateX(3px); }
.org-avatar { transition: transform var(--t-base) var(--ease-spring), background-color var(--t-base); background: linear-gradient(145deg, var(--c-brand-50), var(--c-brand-100)) !important; color: var(--c-brand-600) !important; font-weight: 700 !important; }

.overview-row, .task-row, .document-row, .member-row { transition: background-color var(--t-fast), box-shadow var(--t-base); border-radius: 10px; }
.overview-row:hover, .document-row:hover { background: linear-gradient(90deg, #f7faf8, transparent); box-shadow: -12px 0 0 #f7faf8; }
.overview-row h3 { transition: color var(--t-fast); }
.overview-row a:hover h3 { color: var(--c-brand-700); }
.document-row:hover .document-icon { transform: translateY(-2px) rotate(-3deg); }

.task-state-icon { display: inline-grid; place-items: center; color: var(--c-subtle) !important; font-size: 21px; transition: color var(--t-base); }
.task-state-icon.is-done { color: var(--c-brand-500) !important; }
.task-state-icon.is-done .icon { animation: cs-pop .45s var(--ease-spring) both; }
@keyframes cs-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.overdue-task { box-shadow: inset 3px 0 0 var(--c-warn); padding-left: 16px !important; }

/* Aufklappbereiche */
.task-edit summary, .auth-help summary {
    list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-weight: 600; padding: 6px 10px; margin-left: -10px; border-radius: 8px;
    transition: background-color var(--t-fast), color var(--t-fast);
}
.task-edit summary::-webkit-details-marker, .auth-help summary::-webkit-details-marker { display: none; }
.task-edit summary::before {
    content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform var(--t-base) var(--ease-out);
}
.task-edit[open] summary::before { transform: rotate(45deg); }
.task-edit summary:hover { background: var(--c-brand-50); }
.task-edit[open] > form { animation: cs-rise .3s var(--ease-out) both; }

/* Fortschritt */
.task-progress progress, .onboarding-body progress { height: 8px !important; border-radius: 999px !important; }
.task-progress progress::-webkit-progress-bar, .onboarding-body progress::-webkit-progress-bar { background: #e9efeb; border-radius: 999px; }
.task-progress progress::-webkit-progress-value, .onboarding-body progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--c-brand-400), var(--c-brand-600)); border-radius: 999px;
    transition: width .9s var(--ease-out);
}
.task-progress progress::-moz-progress-bar, .onboarding-body progress::-moz-progress-bar { background: linear-gradient(90deg, var(--c-brand-400), var(--c-brand-600)); border-radius: 999px; }
@media (prefers-reduced-motion: no-preference) {
    .task-progress progress, .onboarding-body progress { animation: cs-grow-x .9s var(--ease-out) .2s both; }
}
@keyframes cs-grow-x { from { clip-path: inset(0 100% 0 0 round 999px); } to { clip-path: inset(0 0 0 0 round 999px); } }

/* ---------- Hinweise & Leerzustände ---------- */
.alert, .document-success, .auth-main .alert-success, .task-warning {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: var(--r-md) !important;
    animation: cs-slide-down .4s var(--ease-out) both;
}
.document-success::before, .alert::before {
    flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; content: "";
    background: currentColor;
    -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat;
}
.document-success { --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.3 12.2 2.6 2.6 5-5.3'/%3E%3C/svg%3E"); }
.alert { --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5M12 16h.01'/%3E%3C/svg%3E"); background: var(--c-danger-bg) !important; color: var(--c-danger) !important; }
.notice { border-radius: var(--r-md) !important; border: 1px solid var(--c-line); background: linear-gradient(160deg, #f7faf8, #f1f6f3) !important; }

.empty-state {
    border: 1.5px dashed var(--c-line-strong) !important; border-radius: var(--r-md) !important;
    background: linear-gradient(160deg, rgb(255 255 255 / .9), rgb(244 248 246 / .9)) !important;
}
.empty-state > span {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: var(--c-surface); color: var(--c-brand-500) !important; font-size: 20px !important;
    box-shadow: var(--sh-sm);
    animation: cs-float 4s ease-in-out infinite;
}
@keyframes cs-float { 50% { transform: translateY(-3px); } }

.customer-welcome { position: relative; overflow: hidden; border-color: var(--c-brand-100) !important; box-shadow: var(--sh-sm); }
.customer-welcome::after {
    content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
    border: 1px solid rgb(15 138 122 / .12); box-shadow: 0 0 0 40px rgb(15 138 122 / .03), 0 0 0 80px rgb(15 138 122 / .02);
    pointer-events: none;
}
.customer-welcome .welcome-symbol { animation: cs-pop .6s var(--ease-spring) .25s both; }

/* ---------- Nachrichten ---------- */
.message-bubble { box-shadow: var(--sh-xs); animation: cs-rise .4s var(--ease-out) both; }
.message-bubble.own-message { background: linear-gradient(160deg, #e9f5ef, #e1f0e8) !important; }
.message-history .message-bubble:nth-last-child(1) { animation-delay: .05s; }
.message-compose textarea { transition: border-color var(--t-fast), box-shadow var(--t-base); }
.notification-option { border-radius: 10px; transition: background-color var(--t-fast); padding-left: 10px !important; padding-right: 10px !important; }
.notification-option:hover { background: #f7faf8; }

/* ---------- Seiten-Einblendung (gestaffelt) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .page-enter > * { animation: cs-rise .55s var(--ease-out) both; }
    .page-enter > *:nth-child(1) { animation-delay: 0ms; }
    .page-enter > *:nth-child(2) { animation-delay: 40ms; }
    .page-enter > *:nth-child(3) { animation-delay: 80ms; }
    .page-enter > *:nth-child(4) { animation-delay: 120ms; }
    .page-enter > *:nth-child(5) { animation-delay: 160ms; }
    .page-enter > *:nth-child(6) { animation-delay: 200ms; }
    .page-enter > *:nth-child(n+7) { animation-delay: 240ms; }

    .page-enter .stat-grid > article, .page-enter .cards > article, .page-enter .customer-modules > article {
        animation: cs-rise .55s var(--ease-out) both;
    }
    .page-enter .stat-grid > article:nth-child(2), .page-enter .cards > article:nth-child(2), .page-enter .customer-modules > article:nth-child(2) { animation-delay: 70ms; }
    .page-enter .stat-grid > article:nth-child(3), .page-enter .cards > article:nth-child(3), .page-enter .customer-modules > article:nth-child(3) { animation-delay: 140ms; }
    .page-enter .stat-grid > article:nth-child(4), .page-enter .cards > article:nth-child(4) { animation-delay: 210ms; }
    .page-enter .stat-grid > article:nth-child(n+5), .page-enter .cards > article:nth-child(n+5) { animation-delay: 260ms; }

    .page-enter .overview-row, .page-enter .task-row, .page-enter .document-row, .page-enter tbody tr { animation: cs-fade .5s var(--ease-out) both; animation-delay: .18s; }

    .onboarding-body, .invitation-card { animation: cs-rise .55s var(--ease-out) both; }
    .onboarding-rail { animation: cs-rise .55s var(--ease-out) both; }
    .onboarding-help, .invitation-help { animation: cs-rise .55s var(--ease-out) .12s both; }
    .onboarding-steps .current > span { animation: cs-ring 2.6s var(--ease-out) infinite; }
}
@keyframes cs-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes cs-ring { 0% { box-shadow: 0 0 0 0 rgb(35 139 118 / .35), 0 0 0 5px #eef7f0; } 70%, 100% { box-shadow: 0 0 0 10px rgb(35 139 118 / 0), 0 0 0 5px #eef7f0; } }

/* ---------- Navigations-Ladebalken ---------- */
.nav-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 1000; pointer-events: none;
    background: linear-gradient(90deg, var(--c-brand-400), #2fc4a8, var(--c-brand-600));
    box-shadow: 0 0 10px rgb(47 196 168 / .6);
    transform: scaleX(0); transform-origin: left; opacity: 0;
}
.nav-progress.is-active { opacity: 1; animation: cs-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
.nav-progress.is-done { animation: none; transform: scaleX(1); opacity: 0; transition: transform .2s ease-out, opacity .35s ease .15s; }
@keyframes cs-progress { 0% { transform: scaleX(0); } 10% { transform: scaleX(.35); } 40% { transform: scaleX(.7); } 100% { transform: scaleX(.94); } }

/* ---------- Skeleton ---------- */
.page-skeleton { display: none; }
html.is-navigating .workspace-shell main { display: none; }
html.is-navigating .workspace-shell .page-skeleton {
    display: block;
    max-width: 1400px; margin: auto; padding: 38px 40px 60px;
    animation: cs-fade .25s ease both;
}
.sk {
    position: relative; overflow: hidden; border-radius: 8px;
    background: #e8eeea;
}
.sk::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / .65), transparent);
    animation: cs-shimmer 1.4s ease-in-out infinite;
}
@keyframes cs-shimmer { to { transform: translateX(100%); } }
.sk-eyebrow { width: 140px; height: 10px; margin-top: 10px; }
.sk-title { width: min(520px, 80%); height: 38px; margin: 18px 0 16px; border-radius: 10px; }
.sk-text { width: min(380px, 60%); height: 14px; }
.sk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 30px 0 25px; }
.sk-card, .sk-panel { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.sk-card { display: flex; align-items: center; gap: 17px; padding: 22px; }
.sk-icon { width: 45px; height: 45px; border-radius: 12px; flex-shrink: 0; }
.sk-lines { flex: 1; display: grid; gap: 9px; }
.sk-number { width: 44px; height: 26px; }
.sk-label { width: 70%; height: 10px; }
.sk-columns { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; }
.sk-panel { padding: 26px; display: grid; gap: 14px; align-content: start; }
.sk-heading { width: 160px; height: 18px; margin-bottom: 8px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid #eef2ef; }
.sk-avatar { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
.sk-line { height: 12px; width: 100%; }
.sk-line-sm { width: 35% !important; height: 9px; }
.sk-pill { width: 64px; height: 22px; border-radius: 999px; flex-shrink: 0; }
.sk-field { height: 45px; margin-top: 8px; }
.sk-button { height: 42px; margin-top: 10px; background: #d5e8e0; }
.sk-card:nth-child(2) .sk::after, .sk-row:nth-child(3) .sk::after { animation-delay: .12s; }
.sk-card:nth-child(3) .sk::after, .sk-row:nth-child(4) .sk::after { animation-delay: .24s; }
@media (max-width: 1250px) { .sk-columns { grid-template-columns: 1fr; } }
@media (max-width: 900px) { html.is-navigating .workspace-shell .page-skeleton { padding: 28px 24px; } .sk-stats { gap: 10px; } .sk-icon { display: none; } .sk-card { padding: 15px; } }
@media (max-width: 650px) { html.is-navigating .workspace-shell .page-skeleton { padding: 25px 18px; } }

/* ---------- Anmeldung ---------- */
.auth-main input:not([type=checkbox]):not([type=hidden]) { border-radius: 10px !important; }
.auth-submit span { transition: transform var(--t-base) var(--ease-out); }
.auth-main .auth-submit:hover span { transform: translateX(4px); }
.auth-language button { transition: color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-base) var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
    .auth-glass-document { animation: cs-drift-a 9s ease-in-out infinite; }
    .auth-glass-check { animation: cs-drift-b 11s ease-in-out infinite; }
    .auth-glass-back { animation: cs-drift-c 13s ease-in-out infinite; }
    .auth-orbit { animation: cs-orbit 40s linear infinite; border-style: dashed !important; border-color: rgb(255 255 255 / .08) !important; }
    .auth-glass-check svg path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: cs-draw .9s var(--ease-out) .5s forwards; }
    .auth-kicker span, .auth-art-label span { animation: cs-pulse-dot 2s ease-in-out infinite; }
    .auth-story-content > * { animation: cs-rise .8s var(--ease-out) both; }
    .auth-story-content > *:nth-child(2) { animation-delay: .08s; }
    .auth-story-content > *:nth-child(3) { animation-delay: .16s; }
    .auth-story-content > *:nth-child(4) { animation-delay: .24s; }
}
@keyframes cs-drift-a { 50% { transform: rotate(-6deg) translateY(-8px); } }
@keyframes cs-drift-b { 50% { transform: rotate(11deg) translate(4px, 6px); } }
@keyframes cs-drift-c { 50% { transform: rotate(18deg) translateY(-5px); } }
@keyframes cs-orbit { to { transform: rotate(360deg); } }
@keyframes cs-draw { to { stroke-dashoffset: 0; } }

/* ---------- Onboarding ---------- */
.onboarding-steps li > span { transition: background-color var(--t-base), box-shadow var(--t-base), color var(--t-base); }
.onboarding-steps .current > span { background: linear-gradient(145deg, #17a593, var(--c-brand-700)) !important; border-color: transparent !important; }
.customer-journey li.current > span { background: linear-gradient(145deg, #17a593, var(--c-brand-700)) !important; border-color: transparent !important; }

/* ---------- Bildlaufleiste ---------- */
* { scrollbar-width: thin; scrollbar-color: #cdd8d2 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd8d2; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b3c3bb; }

/* ---------- Responsiv ---------- */
@media (max-width: 650px) {
    .workspace-shell .sidebar nav a .icon { display: none; }
    .workspace-shell .sidebar nav a::before { display: none; }
    .workspace-topbar { position: static; }
    .overview-filters { display: flex !important; border-radius: 14px; }
}

/* ---------- Modale Fenster (Anlegen / Bearbeiten) ---------- */
html:has(dialog.modal[open]) { overflow: hidden; }
dialog.modal {
    width: min(620px, calc(100vw - 32px)); max-height: min(90vh, 920px); padding: 0; margin: auto;
    border: 1px solid var(--c-line); border-radius: var(--r-xl); background: var(--c-surface); color: var(--c-ink);
    box-shadow: var(--sh-lg); overflow: hidden; font-size: 14px; font-weight: 400; text-align: left; white-space: normal; letter-spacing: normal;
}
dialog.modal.is-wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal[open] { display: flex; flex-direction: column; animation: cs-modal-in .28s var(--ease-out) both; }
dialog.modal::backdrop { background: rgb(16 40 35 / .45); backdrop-filter: blur(3px); animation: cs-fade .2s ease-out both; }
@keyframes cs-modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 18px 26px; border-bottom: 1px solid var(--c-line); flex: none; }
.modal-head h2 { margin: 0 !important; font-size: 18px !important; line-height: 1.3; }
.workspace-shell button.modal-close, button.modal-close {
    display: grid; place-items: center; width: 34px; height: 34px; padding: 0 !important; margin: 0 !important; flex: none;
    border: 0 !important; border-radius: 9px; background: transparent !important; color: var(--c-muted) !important; box-shadow: none !important;
    font-size: 18px; cursor: pointer; transform: none !important;
}
.workspace-shell button.modal-close:hover, button.modal-close:hover { background: var(--c-brand-50) !important; color: var(--c-brand-700) !important; }
.workspace-shell button.modal-close::after { display: none; }
.modal-body { padding: 22px 26px 26px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > :first-child { margin-top: 0; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-body > p { font-size: 13px; color: var(--c-ink-2); }
.modal-body form > button[type=submit] { width: 100%; margin-top: 18px; }
.modal-body .notice { margin-top: 20px; font-size: 12px; }
.modal-body .form-grid { gap: 0 16px; }
/* Dezente Bearbeiten-Schaltfläche in Listenzeilen */
.workspace-shell button.modal-edit, button.modal-edit {
    display: inline-flex; align-items: center; gap: 7px; width: auto; margin: 14px 0 0 -10px; padding: 6px 10px !important;
    border: 0 !important; border-radius: 8px; background: transparent !important; color: var(--c-brand-600) !important; box-shadow: none !important;
    font-size: 12.5px; font-weight: 600; cursor: pointer; transform: none !important;
}
.workspace-shell button.modal-edit:hover, button.modal-edit:hover { background: var(--c-brand-50) !important; color: var(--c-brand-700) !important; }
.workspace-shell button.modal-edit::after { display: none; }
.modal-edit .icon { font-size: 14px; }
.modal-secondary-action { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-line); text-align: center; }
.modal-secondary-action form { margin: 0; }
.modal-edit-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.page-heading > .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.page-heading > button, .page-heading > .actions > button { flex: none; white-space: nowrap; }
@media (max-width: 650px) {
    dialog.modal, dialog.modal.is-wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .modal-head { padding: 16px 14px 16px 20px; }
    .modal-body { padding: 18px 20px 24px; }
    .page-heading { flex-wrap: wrap; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
    .sk::after, .pilot-dot::after { display: none; }
}
