/* ══════════════════════════════════════════════════════════════════
   Sell.ly CRM — Auto-generated CSS bundle
   DO NOT EDIT — modify files in styles/ instead.
   Generated: 2026-07-27T14:14:44Z
   ══════════════════════════════════════════════════════════════════ */


/* Design tokens & CSS variables */

/* ══════════════════════════════════════════════════════════════════
   Sell.ly CRM — Design System
   Apple-style Dark Mode Glassmorphism — SVG Icons, no emoji.
   ══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    /* Surface — deep dark with subtle blue undertone */
    --bg-primary: #060a14;
    --bg-secondary: #0c1222;
    --bg-card: rgba(12, 18, 34, 0.75);
    --bg-hover: rgba(30, 41, 64, 0.5);
    --bg-input: rgba(12, 18, 34, 0.5);
    --bg-elevated: rgba(18, 26, 48, 0.9);

    /* Glass — opaque dark panels (no blur for performance) */
    --glass-bg: rgba(12, 18, 34, 0.92);
    --glass-bg-solid: rgba(12, 18, 34, 0.97);
    --glass-border: rgba(148, 163, 184, 0.07);
    --glass-border-hover: rgba(99, 102, 241, 0.35);
    --glass-border-subtle: rgba(148, 163, 184, 0.04);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a5b4fc;

    /* Brand — refined indigo palette */
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.2);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    /* Status */
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;

    /* Calendar / event-type colors (reused by Termin & Quickactions) */
    --event-call: #2f6fb2;
    --event-meeting: #2f8f9d;
    --event-task: #a93b6e;
    --event-deadline: #8c1f2f;
    --event-followup: #c98a2b;

    /* ── Chart palette (dashboard KPIs) ─────────────────────────────
       Categorical, CVD-ordered, ≥3:1 on the dark bg; bound stably per
       category key by widget/color.rs. */
    --chart-cat-1: #6366f1;  --chart-cat-2: #22d3ee;  --chart-cat-3: #f59e0b;
    --chart-cat-4: #ec4899;  --chart-cat-5: #34d399;  --chart-cat-6: #a78bfa;
    --chart-cat-7: #f87171;  --chart-cat-8: #38bdf8;  --chart-cat-9: #fbbf24;
    --chart-cat-10: #2dd4bf; --chart-cat-11: #c084fc; --chart-cat-12: #fb923c;
    --chart-neutral: #475569;
    --chart-grid: rgba(255, 255, 255, 0.07);
    --chart-axis: rgba(255, 255, 255, 0.35);
    --chart-stroke: rgba(255, 255, 255, 0.14);
    --chart-stroke-hover: rgba(255, 255, 255, 0.35);
    /* Sequential (single-metric trend) + diverging (signed delta) */
    --chart-seq-1: #312e81; --chart-seq-2: #4f46e5; --chart-seq-3: #6366f1;
    --chart-seq-4: #22a3d4; --chart-seq-5: #67e8f9;
    --chart-pos: #34d399; --chart-neg: #f87171;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Pipeline board — harmonised with the app / contact-profile glass look */
    --pl-surface: var(--glass-bg);             /* columns · cards · toolbar chips */
    --pl-surface-alt: rgba(0, 0, 0, 0.22);     /* darker inset: value block · avatar panel */
    --pl-count-badge: #e11d48;                 /* coral count badge (matches profile pipeline) */
    --pl-bullet: var(--accent);                /* indigo field dots */
    --pl-avatar: var(--accent-gradient);       /* VN avatar (like .cp-avatar) */

    /* Admin section rail (collapsed icon rail → hover/edit-expand overlay) */
    --admin-rail-w: 76px;
    --admin-rail-w-open: 284px;
    --app-rail-w: 64px; /* width of the global app sidebar (foundation/_layout) */

    /* Shadows — richer depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 24px var(--accent-glow), 0 0 48px rgba(99,102,241,0.08);
    --shadow-inner-glow: inset 0 1px 0 rgba(255,255,255,0.03);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    /* The one easing curve — for @keyframes animation timing-functions. */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* ============================================================
   User appearance — makes the Darstellung settings actually take
   effect app-wide. Driven by attributes the JS sets on <html>:
     data-theme="light|dark"   · data-font-size="small|medium|large"
     data-compact="0|1"        · data-has-bg + --app-bg-image
   These override the base tokens in foundation/_tokens.css (their
   `:root[...]` specificity wins regardless of order).
   ============================================================ */

/* ── Light theme: override the dark tokens ───────────────────── */
:root[data-theme="light"] {
    --bg-primary: #eef2f7;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(15, 23, 42, 0.05);
    --bg-input: #ffffff;
    --bg-elevated: #ffffff;

    --glass-bg: rgba(255, 255, 255, 0.86);
    --glass-bg-solid: rgba(255, 255, 255, 0.97);
    --glass-border: rgba(15, 23, 42, 0.1);
    --glass-border-hover: rgba(99, 102, 241, 0.4);
    --glass-border-subtle: rgba(15, 23, 42, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-accent: #4f46e5;

    --accent-soft: rgba(99, 102, 241, 0.1);
    --accent-glow: rgba(99, 102, 241, 0.18);

    --chart-grid: rgba(15, 23, 42, 0.08);
    --chart-axis: rgba(15, 23, 42, 0.4);
    --chart-stroke: rgba(15, 23, 42, 0.14);

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.1);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);
    --shadow-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* `System` (auto): follow the OS preference — reuse the light overrides when
   the OS asks for light. (Dark is the base, so no auto+dark block needed.) */
@media (prefers-color-scheme: light) {
    :root[data-theme="auto"] {
        --bg-primary: #eef2f7;
        --bg-secondary: #e2e8f0;
        --bg-card: rgba(255, 255, 255, 0.8);
        --bg-hover: rgba(15, 23, 42, 0.05);
        --bg-input: #ffffff;
        --bg-elevated: #ffffff;
        --glass-bg: rgba(255, 255, 255, 0.86);
        --glass-bg-solid: rgba(255, 255, 255, 0.97);
        --glass-border: rgba(15, 23, 42, 0.1);
        --glass-border-hover: rgba(99, 102, 241, 0.4);
        --glass-border-subtle: rgba(15, 23, 42, 0.06);
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-muted: #64748b;
        --text-accent: #4f46e5;
        --accent-soft: rgba(99, 102, 241, 0.1);
        --accent-glow: rgba(99, 102, 241, 0.18);
        --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.1);
        --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
        --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);
    }
}

/* ── Font size: scale the rem base on <html> ─────────────────── */
:root { font-size: 16px; }
:root[data-font-size="small"] { font-size: 14.5px; }
:root[data-font-size="large"] { font-size: 18px; }

/* ── Compact mode: tighten the spacing scale ─────────────────── */
:root[data-compact="1"] {
    --space-xs: 3px;
    --space-sm: 6px;
    --space-md: 11px;
    --space-lg: 16px;
    --space-xl: 22px;
    --space-2xl: 32px;
}

/* ── Background image layer (behind the translucent UI) ──────── */
/* PAINT-ORDER-FALLE: body::before (z:-1) malt VOR dem body-Hintergrund,
   aber body selbst malt danach OPAK drüber (Reihenfolge im Root-Context:
   html-Canvas → negative-z-Kinder → Block-Hintergründe). Mit aktivem Bild
   muss body deshalb durchsichtig sein — html behält --bg-primary als
   Grund unter dem Bild, der Scrim unten hält Text lesbar. */
:root[data-has-bg="1"] body {
    background: transparent;
}
/* WICHTIG: Die Bild-Ebene liegt auf den HTML-Pseudos (:root::before), NICHT
   auf body::before — das ist vom Ambient-Glow (_reset.css) belegt. Ein Element
   hat nur EIN ::before; die Regeln kollidierten und das Bild landete im
   600px-Glow-Kreis (opacity .25) oben links. */
:root[data-has-bg="1"]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: var(--app-bg-image);
    /* Modus pro Hintergrund (Admin-kuratiert), via JS-Vars gesteuert:
       Füllen (cover) · Einpassen (contain) · Zentriert (auto) · Kacheln. */
    background-size: var(--app-bg-size, cover);
    background-position: var(--app-bg-position, center);
    background-repeat: var(--app-bg-repeat, no-repeat);
    /* Fläche um nicht-füllende Motive: kuratierte Farbe oder App-Standard. */
    background-color: var(--app-bg-color, var(--bg-primary));
    pointer-events: none;
}
/* A subtle scrim keeps text legible over busy images/GIFs. */
:root[data-has-bg="1"]::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-primary);
    opacity: 0.35;
    pointer-events: none;
}

/* Browser reset & box-sizing */

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    height: 100vh;
    overflow-y: hidden;
}

/* Ambient glow — static, no animation, no blur (GPU-friendly) */
body::before {
    content: ''; position: fixed; z-index: -1;
    width: 600px; height: 600px; border-radius: 50%;
    pointer-events: none; opacity: 0.25;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -10%; left: -5%;
}


/* Typography base */

/* ── Typography ────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-xl); padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.page-title { color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: var(--space-xs); }


/* Button system */

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary {
    background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover); box-shadow: var(--shadow-glow);
}
.btn-secondary {
    background: transparent; color: var(--text-primary);
    border-color: var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover); border-color: var(--accent);
}
.btn-danger {
    background: var(--danger); color: white; border-color: var(--danger);
}
.btn-ghost {
    background: transparent; color: var(--text-secondary); border: none;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); }

.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* Forms & inputs */

/* ── Form ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-label {
    display: block; font-size: 0.8125rem; font-weight: 500;
    color: var(--text-secondary); margin-bottom: var(--space-xs);
}
.input {
    width: 100%; padding: var(--space-sm) var(--space-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font-sans); font-size: 0.875rem;
    transition: border-color var(--transition-fast);
    outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-error { border-color: var(--danger); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: var(--space-xs); }

/* ── .input-field: the app-wide control class (inputs, selects, textareas) ──
   Previously unstyled → rendered as native white boxes. Themed here to match
   the dark glass UI everywhere it's used (settings, admin, IT cockpit, inbox). */
.input-field {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.4;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:hover { border-color: var(--glass-border-hover); }
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-field:disabled { opacity: 0.55; cursor: not-allowed; }

/* Native selects: dark background + custom chevron (no white OS control). */
select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: calc(var(--space-md) * 2.4);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
}
/* The popup list follows the OS theme; this styles it where supported. */
select.input-field option { background: #0c1222; color: var(--text-primary); }

textarea.input-field { resize: vertical; min-height: 84px; }

/* Kill the native (white) number spinner — clean dark field; min/max still validate. */
input[type="number"].input-field { -moz-appearance: textfield; appearance: textfield; }
input[type="number"].input-field::-webkit-outer-spin-button,
input[type="number"].input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Tint native checkboxes/radios so they read on dark. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); cursor: pointer; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: all var(--transition-normal);
}
.card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md), var(--shadow-inner-glow);
}
.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.card-title { font-size: 0.9375rem; font-weight: 600; }
.card-body { padding: var(--space-lg); }


/* Cards, stat cards, dashboard grid, activities */

/* ── Stat Cards ────────────────────────────────────────────────── */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md); margin-bottom: var(--space-xl);
}
.stat-card {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    padding: var(--space-lg); display: flex; align-items: center; gap: var(--space-md);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    position: relative; overflow: hidden;
    animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.stat-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--glass-shine); pointer-events: none;
}
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 80ms; }
.stat-card:nth-child(3) { animation-delay: 160ms; }
.stat-card:nth-child(4) { animation-delay: 240ms; }
.stat-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-3px);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-content { flex: 1; }
.stat-value {
    font-size: 1.625rem; font-weight: 700; display: block;
    letter-spacing: -0.02em; line-height: 1.2;
}
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }
.stat-change { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.stat-change.positive { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.stat-change.negative { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* ── Dashboard Grid ────────────────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-md);
}

/* ── Activities ────────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.activity-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0; border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}
.activity-item:last-child { border-bottom: none; }
.activity-action { font-size: 0.875rem; display: block; }
.activity-detail { font-size: 0.8125rem; color: var(--text-muted); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }


/* Table styles */

/* ── Table ─────────────────────────────────────────────────────── */
.table-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: rgba(15, 23, 42, 0.5); }
.data-table th {
    padding: var(--space-md) var(--space-lg); text-align: left;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}
.data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    font-size: 0.875rem;
}
.table-row { transition: background var(--transition-fast); }
.table-row:hover { background: var(--bg-hover); }
.table-row.clickable { cursor: pointer; }

.cell-name { display: flex; align-items: center; gap: var(--space-md); font-weight: 500; }
.contact-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; letter-spacing: -0.02em;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* ── Status Badges ─────────────────────────────────────────────── */
.status-badge {
    font-size: 0.75rem; font-weight: 600; padding: 2px 10px;
    border-radius: var(--radius-full);
}
.status-lead { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.status-qualified { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-customer { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-churned { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-archived { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }


/* Status badges */

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); width: 90%; max-width: 500px;
    box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-lg); border-bottom: 1px solid var(--glass-border);
}
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.25rem; cursor: pointer; padding: var(--space-xs);
    transition: color var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: var(--space-lg); }
.modal-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.modal-actions {
    display: flex; justify-content: flex-end; gap: var(--space-sm);
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}


/* Modal dialogs */

/* ── Login ─────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}
.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: var(--space-2xl); width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: var(--space-xl); }
.brand-icon-large { font-size: 3rem; color: var(--accent); display: block; margin-bottom: var(--space-sm); }
.brand-icon-large svg {
    /* 72 statt 64 — gleiche Begründung wie .brand-icon im Layout-CSS.
       Von Jo am 2026-07-23 so abgenommen („Login passt"). */
    width: 72px; height: 72px;
    filter: drop-shadow(0 6px 18px rgba(99, 102, 241, 0.45));
}
.login-brand h1 { font-size: 2rem; letter-spacing: -0.03em; }
.login-subtitle { color: var(--text-muted); font-size: 0.875rem; }
.login-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.login-error {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger); padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm); font-size: 0.8125rem;
}
/* Neutral instruction (2FA second step) — informational, not an error. */
.login-hint {
    background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-secondary); padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm); font-size: 0.8125rem;
}


/* Utilities, header actions, view toggle */

/* ── Utilities ─────────────────────────────────────────────────── */
.text-danger { color: var(--danger); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Header Actions ────────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: var(--space-md); }

/* ── View Toggle ───────────────────────────────────────────────── */
.view-toggle {
    display: flex; background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    overflow: hidden;
}
.toggle-btn {
    padding: 7px 16px; background: none; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
/* Divider between the two segments so the icons don't sit cramped together. */
.view-toggle .toggle-btn + .toggle-btn { border-left: 1px solid var(--glass-border); }
.toggle-btn.active {
    background: var(--accent); color: white;
}
.toggle-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Contact Grid ──────────────────────────────────────────────── */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Equal-height cards: 1fr auto-rows make every row the same height, and the
       card/link fill their cell (see .contact-card{-link} height:100%). */
    grid-auto-rows: 1fr;
    gap: var(--space-md);
    animation: fadeIn 0.3s ease;
}


/* ── Notification bell (topbar) ─────────────────────────────────── */
.nb-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.nb-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.nb-bell:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}
.nb-bell .icon-inline svg {
    width: 18px;
    height: 18px;
}
.nb-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

/* Click-away layer under the panel */
.nb-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
}
.nb-panel {
    position: absolute;
    top: 48px;
    right: 0;
    width: 340px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 901;
    overflow: hidden;
}
.nb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border-subtle);
}
.nb-head h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.nb-readall {
    border: none;
    background: none;
    color: var(--accent-hover);
    font-size: 0.75rem;
    cursor: pointer;
}
.nb-readall:hover {
    text-decoration: underline;
}
.nb-list {
    overflow-y: auto;
}
.nb-empty {
    margin: 0;
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.nb-item {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--glass-border-subtle);
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.nb-item:hover {
    background: var(--accent-soft);
}
.nb-item:last-child {
    border-bottom: none;
}
.nb-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: transparent;
}
.nb-item.unread .nb-dot {
    background: var(--accent);
}
/* Per-type SVG icon (replaces the old emoji in the title) */
.nb-icon {
    flex: 0 0 18px;
    width: 18px; height: 18px;
    margin-top: 2px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent);
}
.nb-icon svg { width: 16px; height: 16px; display: block; }
.nb-icon-warn { color: #fbbf24; }
.nb-icon-ok   { color: #34d399; }
.nb-icon-cal  { color: #a5b4fc; }
.nb-icon-info { color: #94a3b8; }
.nb-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.nb-title {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
}
.nb-item.unread .nb-title {
    color: #fff;
}
.nb-msg {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}
.nb-time {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 2px;
}

/* App layout, top bar, sidebar */

/* ── App Layout ────────────────────────────────────────────────── */
.app-layout {
    display: flex; height: 100vh;
}
.app-content-area {
    flex: 1; margin-left: 64px; display: flex; flex-direction: column;
    height: 100vh;
    /* Allow shrinking below content width so wide children (e.g. the pipeline
       board) scroll horizontally instead of expanding past the viewport. */
    min-width: 0;
    /* A small top breather so the region isn't crammed against the very edge —
       trimmed from 10→4 to tighten the gap between the top bar and the tab row
       (the reclaimed space lets content, esp. the dashboard grid, grow). */
    padding-top: 4px;
}
/* Fixed shell: the top bar stays put; only .app-main scrolls. This keeps the
   top bar (search + avatar) at the same place on every page — a content
   scrollbar lives inside .app-main, below the bar, and never shifts it.
   scrollbar-gutter keeps the main content itself from jumping too. */
.app-main {
    flex: 1; min-height: 0; min-width: 0; padding: var(--space-md);
    overflow-y: auto; scrollbar-gutter: stable;
}

/* ── Top Bar (slim — no Kopfzeile, collapsed search on the right) ─ */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-bg-solid);
    gap: var(--space-lg);
    min-height: 56px;
}
/* Empty flex filler when a page has no custom topbar content. */
.topbar-spacer { flex: 1; min-width: 0; }
/* Custom top-bar slot (e.g. profile pipeline, a page's slim action row) */
.topbar-slot { flex: 1; min-width: 0; display: flex; }

/* Slim page-action row inside the topbar slot (replaces old page-headers). */
.tb-page-actions {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: var(--space-sm);
}
.tb-page-actions .spacer { flex: 1; }
/* Subtle context text (e.g. "23 Kontakte", calendar range) in the slot. */
.tb-page-context {
    color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
/* Bare top bar: no background/border — content floats on the page bg */
.topbar-bare { background: transparent; border-bottom: none; padding-bottom: var(--space-sm); }
/* Keep a small top pad on bare pages so the scroll container (app-main,
   overflow-y:auto) does not clip the first content row's hover lift + glow
   (e.g. contact/company cards translateY(-2px) + shadow-glow). `~` (not `+`):
   the recent-tabs row may sit between the bar and the main. */
.topbar-bare ~ .app-main { padding-top: 18px; }
/* Profile pages (contact/company: .cp-layout): the recent-tabs row itself
   separates content from the bar — drop the extra pad so the gap below the
   pills (6px row padding) matches the 4px above them. Scoped via :has()
   because list pages need the 18px as hover-lift clip room (see above). */
.tb-tabs ~ .app-main:has(.cp-layout) { padding-top: 0; }
/* Profile topbar: trim the bottom pad and release the 56px min-height so the
   Zurück/pipeline row sits as close above the chips as the cards sit below
   them (measured 12px vs 6px; 6/6 after). Only profiles have .cp-topbar-inner. */
.topbar-bare:has(.cp-topbar-inner) { padding-bottom: 2px; min-height: 0; }
.topbar-actions {
    display: flex; align-items: center; gap: var(--space-md);
}
.topbar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: box-shadow var(--transition-fast);
}
.topbar-avatar:hover { box-shadow: 0 0 0 2px var(--accent); }

/* ── Recent-profile tabs row (browser-tab pills under the topbar) ── */
.tb-tabs {
    display: flex; align-items: center; gap: 8px;
    /* Bottom padding gives the pills clearance from the scroll clip edge
       (overflow-x:auto forces vertical clipping) and breathing room to the
       content below; a smaller top padding lifts the row toward the topbar. */
    padding: 4px var(--space-md) 6px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    /* Fade the right edge as scroll affordance when the row overflows. */
    mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
}
.tb-tabs::-webkit-scrollbar { display: none; }
/* Reveal a thin scrollbar while hovering the row (discoverable scrolling). */
.tb-tabs:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
    mask-image: none;
    -webkit-mask-image: none;
}
.tb-tabs:hover::-webkit-scrollbar { display: block; height: 4px; }
.tb-tabs:hover::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover); border-radius: 2px;
}
/* Pill wrapper — carries visual state + is the drop target. */
.tb-tab {
    display: inline-flex; align-items: center;
    height: 30px; padding: 0 5px 0 0;
    max-width: 210px; flex-shrink: 0; overflow: hidden;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast), border-color var(--transition-fast),
                opacity var(--transition-fast);
    animation: tbTabIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Opacity+scale only — no translateY, which the overflow-clipped row would
   crop at the top edge during the animation. */
@keyframes tbTabIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}
.tb-tab:hover { background: var(--glass-bg-solid); border-color: var(--glass-border-hover); }
.tb-tab.active { background: var(--accent-soft); border-color: var(--accent); }
/* Drag-and-drop reordering feedback. */
.tb-tab.dragging { opacity: 0.4; }
.tb-tab.drag-over { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }

/* The draggable + clickable link area (icon + label). */
.tb-tab-link {
    display: inline-flex; align-items: center; gap: 7px;
    flex: 1; min-width: 0; height: 100%;
    padding: 0 6px 0 11px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.8rem; cursor: pointer;
    transition: color var(--transition-fast);
}
.tb-tab:hover .tb-tab-link, .tb-tab.active .tb-tab-link { color: var(--text-primary); }
.tb-tab-link:active { cursor: grabbing; }
.tb-tab-icon { display: flex; flex-shrink: 0; opacity: 0.75; }
.tb-tab-icon svg { width: 13px; height: 13px; }
.tb-tab-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.tb-tab-close {
    display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; flex-shrink: 0;
    border: none; border-radius: 50%;
    background: transparent; color: var(--text-muted);
    font-size: 0.85rem; line-height: 1; cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.tb-tab-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
    width: 64px; height: 100vh; position: fixed; left: 0; top: 0;
    background: var(--glass-bg-solid);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; z-index: 100;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
/* Expanded via pointer — .sb-open is the JS-tracked pointer-inside state that
   survives the per-page remount (a freshly mounted sidebar under the cursor
   gets no :hover from Chrome until the mouse moves, so route changes would
   otherwise replay the expand animation every time). */
.sidebar:hover,
.sidebar.sb-open {
    width: 240px;
}
/* padding-left 11 statt 24 — gerechnet, nicht geraten: Die eingeklappte Leiste
   ist 64 px breit, die Nav-Icons darunter sitzen bei padding-left 20 in einer
   20-px-Box, ihre Mitte liegt also auf x = 30. Das Marken-Icon stand bei
   padding-left 24 in einer 38-px-Box → Mitte x = 43, gut ein Dutzend Pixel
   weiter rechts als die ganze Navigation darunter. Genau das sah aus der Ferne
   „nicht mittig" aus. 11 + 38/2 = 30 bringt es auf dieselbe Achse.

   Der gap war kurzzeitig 7 — gerechnet als 11 + 38 + 7 = 56, also bündig mit
   den Nav-Beschriftungen. Zwei Dinge sprechen dagegen. Erstens klebte die
   Wortmarke: der Vogel füllt seine 38-px-Box horizontal wirklich aus, 7 px
   daneben liest sich „Sell.ly" als angewachsen (Jo, 2026-07-23). Zweitens ging
   die Rechnung ohnehin nicht auf — im Browser gemessen starten die Nav-Labels
   bei 60, nicht bei 56. Mit space-md beginnt die Wortmarke bei 65: 5 px neben
   der Nav-Kante statt 4 px auf der anderen Seite, derselbe Versatz, aber mit
   Luft. Bei 1.25 rem Fettschrift über kleinen Labels sieht das niemand; das
   Kleben schon. */
.sidebar-brand {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-lg) var(--space-lg) var(--space-lg) 11px;
    border-bottom: 1px solid var(--glass-border);
    min-height: 56px;
}
.brand-icon {
    color: var(--accent); display: flex; align-items: center;
    filter: drop-shadow(0 0 6px var(--accent-glow));
    flex-shrink: 0;
}
/* 38 statt 24 (Jo, 2026-07-23 — 28 und 34 waren beide noch zu klein): der
   Elster-Glyph ist ein Strich, keine Fläche, und wirkt bei gleicher Boxgröße
   deutlich kleiner als das gefüllte Schild davor. Mit der inhaltsgenauen viewBox
   in `icons::LOGO` füllt er die 38 px Breite jetzt wirklich aus; senkrecht
   braucht er nur ~31 px, weil der Vogel breit und flach ist. */
.brand-icon svg { width: 38px; height: 38px; }
.brand-text {
    font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.03em;
    background: var(--accent-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    white-space: nowrap; opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar:hover .brand-text,
.sidebar.sb-open .brand-text { opacity: 1; }

.sidebar-nav { flex: 1; padding: var(--space-md) var(--space-xs); }
.sidebar-footer { padding: var(--space-md) var(--space-xs); border-top: 1px solid var(--glass-border); }

.nav-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: 10px 0; margin-bottom: 2px;
    padding-left: 20px;
    border-radius: var(--radius-sm); position: relative;
    color: var(--text-secondary); text-decoration: none;
    transition: all var(--transition-fast); cursor: pointer;
    border: none; background: none; width: 100%; font-size: 0.875rem;
    font-family: var(--font-sans);
    white-space: nowrap; overflow: hidden;
}
.nav-item:hover {
    background: var(--bg-hover); color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-soft); color: var(--accent-hover);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--accent-gradient);
    box-shadow: 0 0 8px var(--accent-glow);
}
.nav-icon {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: inherit; opacity: 0.65;
    transition: opacity var(--transition-fast);
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item.active .nav-icon svg { filter: drop-shadow(0 0 6px var(--accent-glow)); }

/* Filled-when-active icons (admin shield + opted-in nav items): solid indigo
   silhouette like the shield. Pill/bar/hover-stability come from .nav-item.active. */
.admin-shield-active .nav-icon svg,
.nav-item.nav-fill.active .nav-icon svg {
    fill: var(--accent);
    stroke: var(--accent);
}

.nav-label {
    opacity: 0; white-space: nowrap;
    transition: opacity 0.2s ease;
}
.sidebar:hover .nav-label,
.sidebar.sb-open .nav-label { opacity: 1; }



/* ── Native checkboxes: dark chrome + accent — no white squares in the dark UI ── */
input[type="checkbox"] {
    color-scheme: dark;
    accent-color: var(--accent, #6366f1);
}

/* Login page */

/* ── Skeleton Loading ──────────────────────────────────────────── */
.skeleton {
    position: relative; overflow: hidden;
}
.skeleton::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.05), transparent);
    animation: shimmer 1.5s infinite;
}
.skeleton-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
}
.skeleton-content { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line {
    height: 14px; border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
}
.skeleton-line.wide { width: 70%; }
.skeleton-line.narrow { width: 40%; }

@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Utilities ─────────────────────────────────────────────────── */
.text-danger { color: var(--danger); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Contact cards, grid, profile */

/* ── Contact Card ──────────────────────────────────────────────── */
.contact-card {
    background: var(--glass-bg);

    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    /* Fill the (equal-height) grid cell so every card is the same size, with a
       floor so sparse cards don't collapse. box-sizing keeps padding inside. */
    box-sizing: border-box;
    height: 100%;
    min-height: 148px;
}
.contact-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.contact-card-header {
    display: flex; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--glass-border);
}
.contact-card-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem; flex-shrink: 0;
}
.contact-card-meta { flex: 1; min-width: 0; }
.contact-card-name {
    display: block; font-weight: 600; font-size: 0.9375rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-card-nr {
    font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono);
}

.contact-card-body {
    display: flex; flex-direction: column; gap: 6px;
}
.contact-card-row {
    display: flex; align-items: center; gap: var(--space-sm);
    font-size: 0.8125rem; color: var(--text-secondary);
}
.card-icon {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-muted);
}
.card-icon svg { width: 16px; height: 16px; }

/* ── Status Dots ───────────────────────────────────────────────── */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.status-lead { background: var(--info); }
.status-dot.status-qualified { background: var(--warning); }
.status-dot.status-customer { background: var(--success); }
.status-dot.status-churned { background: var(--danger); }
.status-dot.status-archived { background: var(--text-muted); }

/* ── Table Number Column ───────────────────────────────────────── */
.cell-number {
    font-family: var(--font-mono); font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Form Row (side by side) ───────────────────────────────────── */
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md);
}

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: var(--space-2xl);
    color: var(--text-muted);
}
.empty-icon {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
}
.empty-icon svg { width: 48px; height: 48px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-xs); }
.empty-state p { font-size: 0.875rem; }

/* ── Contact Card Link ─────────────────────────────────────────── */
/* height:100% so the card fills the equal-height grid cell (see .contacts-grid). */
.contact-card-link { text-decoration: none; color: inherit; display: block; height: 100%; }

/* ── Profile Header ────────────────────────────────────────────── */
.profile-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.back-link {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    color: var(--text-muted); text-decoration: none;
    font-size: 0.8125rem; margin-bottom: var(--space-md);
    transition: color var(--transition-fast);
}
.back-link:hover { color: var(--accent); }
.back-icon { display: flex; align-items: center; }
.back-icon svg { width: 16px; height: 16px; }

.profile-header-info {
    display: flex; align-items: center; gap: var(--space-md);
}
.profile-name {
    font-size: 1.5rem; font-weight: 700;
}
.profile-nr {
    font-family: var(--font-mono); font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Profile Layout ────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-lg);
    align-items: start;
}
@media (max-width: 900px) {
    .profile-layout { grid-template-columns: 1fr; }
}

/* ── Profile Sidebar ───────────────────────────────────────────── */
.profile-sidebar {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    position: sticky; top: var(--space-lg);
}

.profile-avatar-section {
    text-align: center;
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.5rem; margin: 0 auto var(--space-md);
}
.profile-sidebar-name {
    font-size: 1.125rem; font-weight: 600; margin-bottom: var(--space-xs);
}

/* ── Profile Sections ──────────────────────────────────────────── */
.profile-section {
    margin-bottom: var(--space-lg);
}
.profile-section:last-child { margin-bottom: 0; }

.profile-section-title {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* ── Detail Rows ───────────────────────────────────────────────── */
.detail-row {
    display: flex; align-items: flex-start; gap: var(--space-md);
    padding: var(--space-sm) 0;
}
.detail-icon {
    width: 18px; height: 18px; display: flex; align-items: center;
    justify-content: center; color: var(--text-muted); flex-shrink: 0;
    margin-top: 2px;
}
.detail-icon svg { width: 16px; height: 16px; }
.detail-content { flex: 1; min-width: 0; }
.detail-label {
    display: block; font-size: 0.6875rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.detail-value {
    display: block; font-size: 0.875rem; word-break: break-word;
}

/* ── Tags ──────────────────────────────────────────────────────── */
.tags-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.tag {
    padding: 2px 10px; border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.12); color: var(--accent);
    font-size: 0.75rem; font-weight: 500;
}

/* ── Profile Actions ───────────────────────────────────────────── */
.profile-actions {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
}
.btn-danger-ghost {
    display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: none; border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger); cursor: pointer; font-family: var(--font-sans);
    font-size: 0.875rem; transition: all var(--transition-fast);
}
.btn-danger-ghost svg { width: 16px; height: 16px; }
.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* ── Glass Panel (right side) ──────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.section-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.section-icon {
    width: 20px; height: 20px; display: flex; align-items: center;
    color: var(--accent);
}
.section-icon svg { width: 18px; height: 18px; }
.section-header h3 { flex: 1; font-size: 1rem; font-weight: 600; }
.section-count {
    background: rgba(99, 102, 241, 0.12); color: var(--accent);
    padding: 2px 8px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 600;
}
.section-empty {
    color: var(--text-muted); font-size: 0.875rem;
    text-align: center; padding: var(--space-lg) 0;
}

/* ── Deal Cards ────────────────────────────────────────────────── */
.deals-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.deal-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-md);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.deal-card:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04);
}

/* ── Filterleiste + Pagination (Kontakt-Übersicht) ───────────────────────── */
.contacts-filterbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.contacts-filterbar .spacer { flex: 1 1 auto; }

.contacts-search { position: relative; display: flex; align-items: center; min-width: 240px; }
.contacts-search-ic {
    position: absolute; left: 10px; display: inline-flex; width: 15px; height: 15px;
    color: var(--text-muted); pointer-events: none;
}
.contacts-search-ic svg { width: 100%; height: 100%; }
.contacts-search-input {
    width: 100%; padding: 8px 12px 8px 32px; font-size: 0.85rem;
    color: var(--text-primary); background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    transition: border-color 0.15s;
}
.contacts-search-input:focus { outline: none; border-color: var(--glass-border-hover); }

.contacts-filter-input, .contacts-filter-select {
    padding: 8px 12px; font-size: 0.82rem; color: var(--text-secondary);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); transition: border-color 0.15s;
}
.contacts-filter-input { min-width: 180px; }
.contacts-filter-input:focus, .contacts-filter-select:hover, .contacts-filter-select:focus {
    outline: none; border-color: var(--glass-border-hover); color: var(--text-primary);
}
.contacts-filter-reset {
    padding: 8px 12px; font-size: 0.8rem; color: var(--text-muted);
    background: transparent; border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.contacts-filter-reset:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.contacts-result-count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.contacts-pager {
    display: flex; align-items: center; justify-content: center; gap: var(--space-md);
    margin-top: var(--space-lg);
}
.contacts-pager-btn {
    padding: 7px 14px; font-size: 0.82rem; color: var(--text-secondary);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.contacts-pager-btn:hover:not(:disabled) { border-color: var(--glass-border-hover); color: var(--text-primary); }
.contacts-pager-btn:disabled { opacity: 0.4; cursor: default; }
.contacts-pager-info { font-size: 0.82rem; color: var(--text-muted); }

/* Tag-Chips auf Karte + in Tabelle. */
.contact-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cell-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.contact-tag-chip {
    display: inline-block; padding: 1px 8px; font-size: 0.72rem; line-height: 1.5;
    color: var(--text-secondary); background: var(--accent-soft);
    border: 1px solid var(--glass-border); border-radius: 999px; white-space: nowrap;
}

/* ── Präzise-Filter: Toggle + Builder ────────────────────────────────────── */
.contacts-filter-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; font-size: 0.82rem; color: var(--text-secondary);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.contacts-filter-toggle:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.contacts-filter-toggle svg { width: 15px; height: 15px; }
.contacts-filter-toggle.on { color: var(--accent); border-color: var(--accent); }

.cf-builder {
    display: flex; flex-direction: column; gap: var(--space-sm);
    margin-bottom: var(--space-md); padding: var(--space-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
/* Each condition is a compact, left-aligned chip-row (fixed field/op widths,
   a capped value field) — not a full-bleed stretch across the whole panel. */
.cf-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm);
    padding: 8px; border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
}
.cf-field { flex: 0 0 200px; min-width: 0; }
.cf-op { flex: 0 0 150px; min-width: 0; }
.cf-val { flex: 0 1 300px; min-width: 150px; }
.cf-val-sm { flex: 0 0 145px; min-width: 0; }
.cf-and { color: var(--text-muted); font-size: 0.85rem; }
/* push the remove button to the row's trailing edge */
.cf-row-remove { margin-left: auto; }
.cf-row-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; flex-shrink: 0;
    background: transparent; border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.cf-row-remove:hover { color: var(--danger); border-color: var(--danger); }
.cf-row-remove svg { width: 14px; height: 14px; }
.cf-add {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    padding: 7px 12px; font-size: 0.82rem; color: var(--accent);
    background: transparent; border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md); cursor: pointer; transition: border-color 0.15s;
}
.cf-add:hover { border-color: var(--accent); }
.cf-add svg { width: 14px; height: 14px; }

/* ═══ Lead-Import-Wizard (/contacts → „Importieren") ════════════════════════ */

.imp-modal { max-width: 62rem; width: 94%; display: flex; flex-direction: column; max-height: 88vh; }
.imp-modal .modal-header { display: flex; align-items: center; gap: var(--space-md); }
/* Body wächst NUR mit dem Inhalt (flex 0) — sonst klebt der Fuß-Button am
   unteren Modalrand mit Leerraum darüber (User-Feedback). */
.imp-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
/* Kompakte zentrierte Inhalts-Spalte (Muster esign-Wizard); Zuordnung/
   Prüfung brauchen die breite Variante für ihre Tabellen. */
.imp-center {
    width: min(640px, 100%); margin: 0 auto;
    display: flex; flex-direction: column; gap: var(--space-md);
}
.imp-center.is-wide { width: min(920px, 100%); }
.imp-foot { display: flex; }
.imp-foot-inner {
    width: min(640px, 100%); margin: 0 auto;
    display: flex; align-items: center; gap: var(--space-sm);
}
.imp-foot-inner.is-wide { width: min(920px, 100%); }
.imp-foot-inner .spacer { flex: 1 1 auto; }

/* Stepper-Pills im Kopf (Muster esign-Wizard, eigene Klassen) */
.imp-steps { display: flex; gap: 6px; margin-left: auto; margin-right: var(--space-sm); }
.imp-step {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 12px; border-radius: var(--radius-full);
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--glass-border); font-size: 0.76rem; font-weight: 600;
    cursor: pointer; transition: var(--transition-fast); white-space: nowrap;
}
.imp-step.is-active { color: var(--text-primary); border-color: var(--glass-border-hover); }
.imp-step.is-done { color: var(--success); border-color: rgba(52, 211, 153, 0.35); }
.imp-step-n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); font-size: 0.66rem;
}

/* Schritt 1: Quelle */
.imp-source { display: flex; flex-direction: column; gap: var(--space-md); }
.imp-hint { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.imp-dropzone {
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-lg); border: 1px dashed var(--glass-border-hover);
    border-radius: var(--radius-md); color: var(--text-secondary);
    font-size: 0.88rem; cursor: pointer; transition: var(--transition-fast);
}
.imp-dropzone:hover { color: var(--text-primary); border-color: var(--text-accent); }
.imp-file-input { display: none; }
.imp-paste { font-family: var(--font-mono); font-size: 0.78rem; resize: vertical; }
.imp-parsed { font-size: 0.85rem; font-weight: 600; color: var(--success); }
.imp-jobs { display: flex; flex-direction: column; gap: 4px; }
.imp-job {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px auto auto;
    gap: var(--space-md); align-items: center;
    font-size: 0.78rem; color: var(--text-secondary);
    padding: 5px 10px; background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
}
.imp-job-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-job-src { font-weight: 700; font-size: 0.68rem; color: var(--text-muted); }
.imp-job-when { color: var(--text-muted); white-space: nowrap; }

/* Schritt 1: Hinweis auf die Lead-Quellen (Web-to-Lead) */
.imp-autoline {
    display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
    padding: var(--space-sm) var(--space-md);
    background: rgba(99, 102, 241, 0.06); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.imp-autoline-txt { flex: 1 1 240px; font-size: 0.8rem; color: var(--text-secondary); }

/* ── Lead-Quellen-Modal (Webformulare + API) ── */
.src-modal { max-width: 52rem; }
.src-new { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.src-new .input-field { flex: 1 1 220px; }
.src-form {
    display: flex; flex-direction: column; gap: 6px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.src-form.is-paused { opacity: 0.55; }
.src-form-head { display: flex; align-items: baseline; gap: var(--space-md); }
.src-form-name { font-weight: 700; color: var(--text-primary); }
.src-form-meta { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.src-form-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.src-del:hover { color: var(--danger); }
.src-form-target { font-size: 0.72rem; font-weight: 700; color: var(--text-accent); white-space: nowrap; }
/* Mini-Editor je Formular (aufklappbar) */
.src-edit {
    display: flex; flex-direction: column; gap: var(--space-sm);
    border-top: 1px solid var(--glass-border); padding-top: var(--space-sm);
}
.src-edit-row { display: flex; flex-direction: column; gap: 4px; }
.src-edit-save { align-self: flex-end; }
.src-api {
    display: flex; flex-direction: column; gap: 6px;
    border-top: 1px solid var(--glass-border); padding-top: var(--space-md);
}
.src-code {
    margin: 0; padding: var(--space-sm) var(--space-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); font-family: var(--font-mono);
    font-size: 0.72rem; white-space: pre-wrap; word-break: break-all;
    color: var(--text-secondary);
}

/* Schritt 2: Zuordnung */
.imp-mapping { display: flex; flex-direction: column; gap: 6px; }
.imp-map-row {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 260px auto;
    gap: var(--space-md); align-items: center;
}
.imp-map-row.is-dupe .imp-map-sel { border-color: rgba(251, 191, 36, 0.55); }
.imp-map-col { font-weight: 600; color: var(--text-primary); font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-map-sample { color: var(--text-muted); font-size: 0.78rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-map-warn { color: var(--warning); font-size: 0.72rem; white-space: nowrap; }
.imp-map-hint { margin: 4px 0 0; color: var(--warning); font-size: 0.8rem; }

/* Schritt 3: Prüfung */
.imp-check { display: flex; flex-direction: column; gap: var(--space-md); }
.imp-sumline { display: flex; align-items: baseline; gap: var(--space-md); flex-wrap: wrap; }
.imp-sum-num { font-weight: 700; color: var(--text-primary); }
.imp-sum-bad { color: var(--warning); font-size: 0.85rem; }
.imp-sum-note { color: var(--text-muted); font-size: 0.78rem; }
.imp-options { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.imp-opt { display: flex; flex-direction: column; gap: 4px; min-width: 16rem; }
.imp-preview { overflow-x: auto; }
.imp-table td, .imp-table th { white-space: nowrap; max-width: 16rem;
    overflow: hidden; text-overflow: ellipsis; }
.imp-cell-num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.imp-row-bad td { color: var(--warning); }
.imp-cell-check { font-size: 0.78rem; }
.imp-empty { color: var(--text-muted); font-size: 0.85rem; }

/* Schritt 4: Import */
.imp-run { display: flex; flex-direction: column; gap: var(--space-md); }
.imp-progress { display: flex; align-items: center; gap: var(--space-md); }
.imp-progress-bar {
    flex: 1 1 auto; height: 10px; border-radius: var(--radius-full);
    background: var(--bg-input); border: 1px solid var(--glass-border); overflow: hidden;
}
.imp-progress-fill { height: 100%; background: var(--text-accent); transition: width 0.2s ease; }
.imp-progress-label { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.imp-result { display: flex; flex-direction: column; gap: var(--space-sm); }
.imp-result-line { display: flex; gap: var(--space-md); align-items: baseline; flex-wrap: wrap; }
.imp-res-ok { font-weight: 700; color: var(--success); }
.imp-res-skip { color: var(--warning); }
.imp-res-err { color: var(--danger); }
.imp-skiplist { max-height: 300px; overflow-y: auto; }

/* Anleitung (personalisierte Web-to-Lead-Doku) */
.doc-modal { max-width: 58rem; }
.doc-modal .modal-header { display: flex; align-items: center; gap: var(--space-md); }
.doc-copy { margin-left: auto; }
.doc-body { gap: var(--space-sm); }
.doc-sec {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted); margin-top: var(--space-sm);
}
.doc-key { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-accent); }
.doc-hint { color: var(--text-muted); font-size: 0.78rem; white-space: normal; }
.src-edit-foot { display: flex; align-items: center; gap: var(--space-sm); }
.src-edit-foot .spacer { flex: 1 1 auto; }
.src-rotate:hover { color: var(--warning); }

/* Pipeline & deals */

.deal-info { flex: 1; min-width: 0; }
.deal-title { display: block; font-weight: 500; font-size: 0.875rem; }
.deal-value { font-size: 0.8125rem; color: var(--text-muted); font-family: var(--font-mono); }
.deal-stage {
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}

/* ── Activity Timeline ─────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
    display: flex; gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
    margin-top: 6px;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-action {
    display: block; font-size: 0.875rem; font-weight: 500;
    text-transform: capitalize;
}
.timeline-detail {
    display: block; font-size: 0.8125rem; color: var(--text-secondary);
    margin-top: 2px;
}
.timeline-meta {
    display: block; font-size: 0.75rem; color: var(--text-muted);
    margin-top: 4px;
}

/* ── Tasks ──────────────────────────────────────────────────── */
.task-filters {
    display: flex; gap: var(--space-sm); margin-bottom: var(--space-lg);
}
.filter-btn {
    padding: 6px 16px; border-radius: var(--radius-full);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text-secondary); cursor: pointer; font-size: 0.8125rem;
    transition: all var(--transition-fast);
}
.filter-btn:hover { border-color: rgba(99, 102, 241, 0.3); }
.filter-btn.active {
    background: rgba(99, 102, 241, 0.15); border-color: var(--accent);
    color: var(--accent); font-weight: 600;
}
.task-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.task-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
}
.task-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid var(--glass-border); display: flex;
    align-items: center; justify-content: center;
    font-size: 0.75rem; flex-shrink: 0; cursor: pointer;
    transition: all var(--transition-fast);
}
.task-check.completed {
    background: rgba(34, 197, 94, 0.2); border-color: #22c55e; color: #22c55e;
}
.task-body { flex: 1; min-width: 0; }
.task-title { display: block; font-weight: 500; margin-bottom: 2px; }
.task-meta { display: block; font-size: 0.75rem; color: var(--text-muted); }
.priority-badge {
    padding: 2px 10px; border-radius: var(--radius-full);
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
}
.priority-low { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.priority-medium { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.priority-high { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.priority-urgent { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ── Notes ──────────────────────────────────────────────────── */
.notes-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.note-card {
    padding: var(--space-md);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--transition-fast);
}
.note-card:hover { border-color: rgba(99, 102, 241, 0.3); }
.note-pin {
    position: absolute; top: 8px; right: 8px;
    background: rgba(99, 102, 241, 0.15); color: var(--accent);
    padding: 1px 8px; border-radius: var(--radius-full);
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
}
.note-content {
    font-size: 0.875rem; line-height: 1.5;
    white-space: pre-wrap; margin: 0 0 var(--space-sm);
}
.note-meta {
    font-size: 0.75rem; color: var(--text-muted);
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes cardEnter {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(99,102,241,0.06); }
}

/* ── Glass Panel (universal — opaque, no blur) ───────────────── */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast);
}
.glass-panel:hover {
    border-color: var(--glass-border-hover);
}

/* ── Premium Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15); border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.25); }

/* ── Loading Text ─────────────────────────────────────────────── */
.loading-text {
    text-align: center; padding: var(--space-2xl);
    color: var(--text-muted); font-size: 0.875rem;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: var(--space-2xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-icon { display: block; margin: 0 auto var(--space-md); opacity: 0.4; }
.empty-icon svg { width: 48px; height: 48px; }

/* ── Error Banner ────────────────────────────────────────────── */
.error-banner {
    background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
    color: #ef4444; font-size: 0.875rem; margin-bottom: var(--space-md);
}

/* ── Selection Glow ───────────────────────────────────────────── */
::selection { background: rgba(99, 102, 241, 0.3); color: white; }

/* ── Companies Page ──────────────────────────────────────────── */
.companies-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}
.company-card { padding: var(--space-lg); }
.company-header { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.company-avatar {
    width: 42px; height: 42px; border-radius: var(--radius-md);
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.company-name { font-weight: 600; font-size: 1rem; display: block; }
.company-industry { font-size: 0.8125rem; color: var(--text-secondary); }
.company-details { display: flex; flex-direction: column; gap: var(--space-xs); }
.company-detail {
    display: flex; align-items: center; gap: var(--space-sm);
    font-size: 0.8125rem; color: var(--text-muted);
}
.company-detail .detail-icon { width: 14px; height: 14px; opacity: 0.5; }
.company-detail .detail-icon svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════════
   Pipeline Board — redesign (.pl-*), flat designer palette, no shadows
   ══════════════════════════════════════════════════════════════ */

/* ── Toolbar (lives in the AppLayout topbar slot) ── */
.pl-toolbar { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.pl-nav-btn {
    width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); background: var(--pl-surface); color: var(--text-primary);
    font-size: 1.15rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.pl-nav-btn:hover { background: var(--bg-hover); border-color: var(--glass-border-hover); }
.pl-select { position: relative; flex-shrink: 0; }
.pl-select-btn {
    display: flex; align-items: center; gap: 10px; min-width: 160px; height: 34px; padding: 0 14px;
    border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--pl-surface);
    color: var(--text-primary); font-size: 0.9375rem; font-weight: 700; cursor: pointer;
    transition: border-color var(--transition-fast);
}
.pl-select-btn:hover { border-color: var(--glass-border-hover); }
.pl-select-caret { margin-left: auto; color: var(--text-muted); font-size: 0.85rem; }
.pl-select-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; min-width: 200px;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px;
    max-height: 320px; overflow-y: auto;
}
.pl-select-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: none;
    border-radius: var(--radius-sm); background: transparent; color: var(--text-primary);
    font-size: 0.875rem; cursor: pointer;
}
.pl-select-item:hover { background: var(--bg-hover); }
.pl-viewtoggle { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-md);
    background: var(--pl-surface); border: 1px solid var(--glass-border); flex-shrink: 0; }
.pl-vbtn {
    width: 32px; height: 28px; border: none; border-radius: 7px; background: transparent;
    color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.pl-vbtn:hover { color: var(--text-primary); }
.pl-vbtn.active { background: var(--accent-soft); color: var(--accent-hover); }
.pl-vbtn svg { width: 16px; height: 16px; }
.pl-new-btn {
    margin-left: auto; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
    flex-shrink: 0; border: none; border-radius: var(--radius-md); background: var(--accent); color: #fff;
    font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background var(--transition-fast);
}
.pl-new-btn:hover { background: var(--accent-hover); }
.pl-new-btn svg { width: 15px; height: 15px; }

/* ── Board + columns ── */
/* Rollback-Banner: erklärt, warum eine verschobene Karte zurückspringt
   (fehlende Berechtigung / fehlgeschlagener Move). */
.pl-move-error {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    z-index: 1200; padding: 10px 18px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: var(--danger); border-radius: var(--radius-md);
    font-size: 0.875rem; white-space: nowrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Pipeline is a full-height page: the board fills the content area so its
   horizontal scrollbar sits at the very bottom edge, and the ENTIRE board area
   (not just the height of the cards) scrolls sideways. Scoped via :has() so
   only the pipeline page turns .app-main into a fill-flex column. */
.app-main:has(.pl-board) {
    display: flex; flex-direction: column; min-height: 0; padding-bottom: 0;
}
.pl-board {
    flex: 1 1 auto; min-height: 0;
    display: flex; gap: var(--space-xs);
    overflow: auto;
    padding-bottom: 2px;
    scroll-behavior: smooth; scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
    overscroll-behavior-x: contain;
}
.pl-board::-webkit-scrollbar { height: 10px; }
.pl-board::-webkit-scrollbar-track { background: transparent; }
.pl-board::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover); border-radius: 5px;
    border: 2px solid transparent; background-clip: padding-box;
}
.pl-board::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
.pl-column { flex: 0 0 330px; max-width: 330px; display: flex; flex-direction: column; gap: var(--space-xs); }
.pl-column.drag-over { box-shadow: inset 0 0 0 2px var(--glass-border-hover); border-radius: var(--radius-xl); }
.pl-column.drag-over .pl-col-stack { pointer-events: none; }

.pl-col-head {
    display: flex; align-items: stretch; height: 56px; flex-shrink: 0; overflow: hidden;
    border-radius: var(--radius-xl); background: var(--pl-surface);
    border: 1px solid var(--glass-border);
    /* Stick to the top of the vertically-scrolling board so a full column's
       cards scroll UNDER the stage header instead of covering it. z-index lifts
       it above the cards (incl. hover-transformed ones). Shared by all three
       board modes (box/graph/list) and the contact + company boards. */
    position: sticky; top: 0; z-index: 5;
}
.pl-col-value {
    width: 92px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center;
    padding: 0 10px; background: var(--pl-surface-alt);
}
.pl-col-value-label { font-size: 0.625rem; font-weight: 700; color: var(--text-secondary); line-height: 1.15; }
.pl-col-value-num { font-size: 0.8125rem; font-weight: 700; color: var(--text-primary); }
.pl-col-title {
    flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 12px;
    font-size: 1.0625rem; font-weight: 700; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-col-count {
    align-self: center; margin-right: 12px; flex-shrink: 0;
    min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--radius-full);
    background: var(--pl-count-badge); color: #fff; font-size: 0.8125rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.pl-col-stack { display: flex; flex-direction: column; gap: var(--space-xs); position: relative; z-index: 1; }

/* ── Deal cards (shared — glass look, like the contact profile) ── */
.pl-card {
    background: var(--pl-surface); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); cursor: grab; overflow: hidden;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.pl-card:hover { border-color: var(--glass-border-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pl-card:active { cursor: grabbing; }
.pl-avatar {
    width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--radius-full);
    background: var(--pl-avatar); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}
.pl-card-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-fields { display: flex; flex-direction: column; gap: 3px; }
.pl-field { display: flex; align-items: center; gap: 7px; font-size: 0.8125rem; min-width: 0; }
.pl-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--pl-bullet); }
.pl-flabel { color: var(--text-secondary); flex-shrink: 0; }
.pl-fval { color: var(--text-primary); font-weight: 600; margin-left: auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Two-tone split — darker inset avatar panel, like the column header pill */
.pl-card-avatarwrap {
    align-self: stretch; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    padding: 0 16px; background: var(--pl-surface-alt);
}

/* Box mode */
.pl-card--box { display: flex; align-items: stretch; }
.pl-card--box .pl-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px; }

/* Graph mode — clean split: left info panel (darker) | right activity chart */
.pl-card--graph { display: flex; align-items: stretch; }
.pl-card--graph .pl-card-left {
    flex: 0 0 45%; min-width: 0; display: flex; flex-direction: column; gap: 8px;
    padding: 12px; background: var(--pl-surface-alt);
}
.pl-card--graph .pl-card-left .pl-avatar { width: 44px; height: 44px; }
.pl-card-chart { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pl-chart-head { display: flex; align-items: center; justify-content: space-between; }
.pl-chart-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.pl-chart-count {
    font-size: 0.6875rem; font-weight: 700; color: var(--accent-hover);
    background: var(--accent-soft); border-radius: var(--radius-full); padding: 1px 8px;
}
.pl-chart-svg { width: 100%; flex: 1; min-height: 60px; display: block; }
.pl-chart-svg polyline {
    fill: none; stroke: var(--accent-hover); stroke-width: 1.75;
    vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
}
.pl-chart-empty {
    flex: 1; min-height: 60px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.18);
    color: var(--text-muted); font-size: 0.75rem; text-align: center;
}

/* List mode */
.pl-card--list { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-full); }
.pl-list-name { font-weight: 700; color: var(--text-primary); font-size: 0.875rem; flex: 0 1 auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-list-owner { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text-secondary); flex-shrink: 0; }
.pl-list-value { margin-left: auto; font-weight: 700; color: var(--text-primary); font-size: 0.8125rem; flex-shrink: 0; }

.pl-empty { font-size: 0.8125rem; color: var(--text-muted); padding: var(--space-md); text-align: center; }
.pl-create-err { color: var(--danger); font-size: 0.8125rem; margin: 0 0 4px; }

/* ── Calendar Page ───────────────────────────────────────────── */
.calendar-view { display: flex; flex-direction: column; gap: var(--space-md); }
.calendar-day { display: flex; flex-direction: column; }
.day-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: var(--space-sm); margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.day-date { font-weight: 600; font-size: 1rem; }
.day-count { font-size: 0.8125rem; color: var(--text-muted); }
.day-tasks { display: flex; flex-direction: column; gap: var(--space-xs); }
.calendar-task {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0;
}
.calendar-task .task-title { font-size: 0.875rem; }

/* ── Settings Page ───────────────────────────────────────────── */
.settings-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-md);
}
.settings-section { padding: var(--space-lg); }
.section-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-lg); padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.section-icon { width: 20px; height: 20px; color: var(--accent); opacity: 0.7; }
.section-icon svg { width: 20px; height: 20px; }
.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-sm) 0; border-bottom: 1px solid var(--glass-border-subtle);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-label { font-size: 0.875rem; font-weight: 500; display: block; }
.setting-desc { font-size: 0.75rem; color: var(--text-muted); }
.setting-value { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.toggle-dot {
    width: 36px; height: 20px; border-radius: 10px;
    background: rgba(100, 116, 139, 0.3); position: relative;
    flex-shrink: 0;
}
.toggle-dot::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-muted); transition: all var(--transition-fast);
}
.toggle-dot.active { background: var(--accent-soft); }
.toggle-dot.active::after { left: 18px; background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   Contact Profile Page — cp-* classes
   ═══════════════════════════════════════════════════════════════ */

/* ── Pipeline Bar ───────────────────────────────────────────── */
.cp-pipeline-bar {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md); margin-bottom: var(--space-lg);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.cp-back-btn {
    display: flex; align-items: center; gap: var(--space-xs);
    color: var(--text-secondary); text-decoration: none; font-size: 0.875rem;
    cursor: pointer; transition: color 0.2s;
}
.cp-back-btn:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════════
   Aufgaben — the /tasks overview, a THREE-COLUMN board (.tsk-* namespace).

   Columns left→right by urgency, colour-coded so the split is glanceable:
     • Überfällig → danger / red      (past-due)
     • Heute      → warning / amber   (due today — the STRONGEST cue)
     • Anstehend  → neutral slate     (future + undated)

   This file: page frame, toolbar, board/columns/cards, drag&drop states,
   undo/error feedback, worker avatar. Siblings (same .tsk-* namespace):
     • _tasks_team.css  — team workload strip + person picker
     • _tasks_modal.css — create-task modal + link search
   Uses only foundation/_tokens.css custom properties. Does NOT collide
   with the profile tasks (.cp-task*) or the old page (.task-*).
   ══════════════════════════════════════════════════════════════════ */

/* ── Page root under AppLayout ─────────────────────────────────── */
.tsk-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg);
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ── Toolbar — the two segmented toggles ("Nur meine" · "Erledigte") ── */
.tsk-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.tsk-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
}
.tsk-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.tsk-seg-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.tsk-seg-btn.is-active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}
.tsk-seg-btn.is-active:hover { background: var(--accent-hover); }

/* ── Board — three equal columns side by side ──────────────────── */
.tsk-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: start;
}
/* Stack on narrow viewports so cards never get crushed. */
@media (max-width: 1000px) {
    .tsk-board { grid-template-columns: 1fr; }
}

/* ── A single column — colour driven by its modifier ───────────── */
.tsk-col {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: 3px solid var(--tsk-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
/* Each column publishes a --tsk-accent read by its dot, count, cards' rail. */
.tsk-col--overdue  { --tsk-accent: var(--danger);         --tsk-accent-soft: rgba(248, 113, 113, 0.12); }
.tsk-col--today    { --tsk-accent: var(--warning);        --tsk-accent-soft: rgba(251, 191, 36, 0.14); }
.tsk-col--upcoming { --tsk-accent: var(--text-secondary); --tsk-accent-soft: rgba(148, 163, 184, 0.12); }

/* "Heute" is the STRONGEST cue — a brighter amber frame + a warm glow so it
   dominates even the red overdue column. */
.tsk-col--today {
    border-color: rgba(251, 191, 36, 0.34);
    box-shadow: var(--shadow-md), 0 6px 22px rgba(251, 191, 36, 0.11);
}

/* ── Column header ─────────────────────────────────────────────── */
.tsk-col-head {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--glass-border-subtle);
    background: linear-gradient(180deg, var(--tsk-accent-soft), transparent);
}
.tsk-col-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--tsk-accent);
    box-shadow: 0 0 0 4px var(--tsk-accent-soft);
}
.tsk-col-title {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}
.tsk-col--today .tsk-col-title { font-size: 1rem; }
.tsk-col--upcoming .tsk-col-title { color: var(--text-secondary); }
.tsk-col-count {
    margin-left: auto;
    min-width: 22px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: var(--tsk-accent-soft);
    color: var(--tsk-accent);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-align: center;
    line-height: 1.4;
}
.tsk-col--upcoming .tsk-col-count { color: var(--text-secondary); }

/* ── Column body — the stack of cards ──────────────────────────── */
.tsk-col-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm);
}
.tsk-col-empty {
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ── Full-height board: columns scroll INTERNALLY (desktop) ────────────
   Browsing one long column must not drag the whole page along — toolbar
   and team strip stay put, each .tsk-col-body gets its own scrollbar.
   Same :has() fill-flex chain as the pipeline board; every flex link
   needs min-height:0 or the columns refuse to shrink below content.
   The stacked mobile layout (≤1000px) keeps normal page scrolling —
   three tiny scroll areas would be worse than one page. */
@media (min-width: 1001px) {
    .app-main:has(.tsk-board) {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .app-main:has(.tsk-board) .tsk-page {
        flex: 1 1 auto;
        min-height: 0;
    }
    /* Fixed chrome above the board: without flex-shrink:0 the fill-flex
       column crushes toolbar and team strip to make room for the board. */
    .app-main:has(.tsk-board) .tsk-toolbar,
    .app-main:has(.tsk-board) .tsk-team {
        flex-shrink: 0;
    }
    .tsk-board {
        flex: 1 1 auto;
        min-height: 0;
        /* Equal-height columns (base rule: start) — an empty column is a
           full-height drop target instead of a stub. */
        align-items: stretch;
    }
    .tsk-col {
        min-height: 0;
    }
    .tsk-col-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--glass-border-hover) transparent;
        /* Reaching a column's end must not hand the wheel to the page. */
        overscroll-behavior: contain;
    }
}

/* ── Task card ─────────────────────────────────────────────────── */
.tsk-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border-subtle);
    border-left: 3px solid var(--tsk-accent);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), transform var(--transition-fast),
                border-color var(--transition-fast);
}
.tsk-card:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}
.tsk-card.is-done {
    border-left-color: transparent;
    opacity: 0.6;
}

.tsk-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
/* Foot aligns under the title (checkbox 22px + 10px gap). */
.tsk-card-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 32px;
}

/* ── Complete-toggle checkbox ──────────────────────────────────── */
.tsk-check {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--glass-border);
    border-radius: 7px;
    background: transparent;
    color: #fff;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                transform var(--transition-fast);
}
.tsk-check:hover {
    border-color: var(--success);
    background: rgba(52, 211, 153, 0.15);
}
.tsk-check.is-done {
    background: var(--success);
    border-color: var(--success);
}
.tsk-check.is-done:hover { transform: scale(1.05); }

/* ── Title ─────────────────────────────────────────────────────── */
.tsk-title {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    word-break: break-word;
}
.tsk-card.is-done .tsk-title {
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Due date (foot, left — pushes avatar+chip to the right edge) ── */
.tsk-due {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.tsk-col--overdue .tsk-due { color: var(--danger);  font-weight: 600; }
.tsk-col--today   .tsk-due { color: var(--warning); font-weight: 600; }
.tsk-card.is-done .tsk-due { color: var(--text-muted); font-weight: 400; }

/* ── Profile chip (contact / company anchor, foot right) ───────── */
.tsk-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.20);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast), background var(--transition-fast),
                border-color var(--transition-fast), transform var(--transition-fast);
}
.tsk-link-ico { display: inline-flex; align-items: center; flex-shrink: 0; }
.tsk-link svg { width: 12px; height: 12px; flex-shrink: 0; display: block; }
.tsk-link:hover {
    color: var(--text-accent);
    background: var(--accent-soft);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
}

/* ── Priority badge (head, right) ──────────────────────────────── */
.tsk-prio {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}
.tsk-prio--low {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.22);
}
.tsk-prio--medium {
    color: var(--info);
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.26);
}
.tsk-prio--high {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.30);
}
.tsk-prio--urgent {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.18);
}

/* ── Per-page empty-state text (glass wrapper reuses .empty-state) ── */
.tsk-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* ── Drag & drop ───────────────────────────────────────────────────
   Dropping a card on a column re-targets its due date (Heute → today,
   Anstehend → +3 Tage, Überfällig → gestern); the hovered column glows in
   its own accent and its header announces the rule via .tsk-drop-hint. */
.tsk-card[draggable="true"] { cursor: grab; }
.tsk-card[draggable="true"]:active { cursor: grabbing; }
.tsk-card.is-dragging {
    opacity: 0.45;
    transform: scale(0.98);
    border-style: dashed;
}
.tsk-col.drag-over {
    border-color: var(--tsk-accent);
    box-shadow: inset 0 0 0 2px var(--tsk-accent), 0 6px 26px var(--tsk-accent-soft);
}
/* Children must not steal dragleave/drop from the column (hover flicker). */
.tsk-col.drag-over .tsk-col-body { pointer-events: none; }

/* Header hint while hovering: what the drop will set ("→ heute"). Sits right
   before the count, pushed to the right edge together with it. */
.tsk-drop-hint {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: var(--tsk-accent);
    color: #0b0f19;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
/* The count keeps its own margin-left:auto; with the hint present both sit
   right — cancel the count's auto so they cluster instead of spreading. */
.tsk-drop-hint + .tsk-col-count { margin-left: 0; }

/* ── Move feedback: rollback banner + undo chip (fixed, bottom-center) ── */
.tsk-move-error {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    z-index: 1200; padding: 10px 18px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: var(--danger); border-radius: var(--radius-md);
    font-size: 0.875rem; white-space: nowrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* A drop rewrites the due date irreversibly — the chip offers the way back. */
.tsk-undo {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    z-index: 1190;
    display: flex; align-items: center; gap: 14px;
    max-width: min(90vw, 560px);
    padding: 10px 12px 10px 18px;
    background: var(--glass-bg-heavy, rgba(15, 20, 34, 0.92));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    animation: tsk-undo-in 160ms ease-out;
}
@keyframes tsk-undo-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.tsk-undo-text {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tsk-undo-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.tsk-undo-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ── Worker avatar (card foot + picker items) ──────────────────────
   The profile chips are CONTACTS — this small initials disc is the only
   thing on a card that says WHOSE work it is. Colour is a stable per-name
   hash across six muted hues; the full name sits in the tooltip. */
.tsk-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: default;
}
.tsk-avatar--0 { background: rgba(96, 165, 250, 0.18);  color: #93c5fd; }
.tsk-avatar--1 { background: rgba(52, 211, 153, 0.16);  color: #6ee7b7; }
.tsk-avatar--2 { background: rgba(251, 191, 36, 0.16);  color: #fcd34d; }
.tsk-avatar--3 { background: rgba(196, 181, 253, 0.16); color: #c4b5fd; }
.tsk-avatar--4 { background: rgba(244, 114, 182, 0.16); color: #f9a8d4; }
.tsk-avatar--5 { background: rgba(45, 212, 191, 0.16);  color: #5eead4; }

/* ── Column quick-add ("+ Aufgabe" → inline title input) ─────────── */
.tsk-add {
    padding: 9px 12px;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast),
                background var(--transition-fast);
}
.tsk-add:hover {
    color: var(--text-accent);
    border-color: var(--glass-border-hover);
    background: var(--accent-soft);
}

/* Toolbar create button (right edge) — the modal's page-level entry point. */
.tsk-new-btn {
    margin-left: auto;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.tsk-new-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }


/* ══════════════════════════════════════════════════════════════════
   Aufgaben — team scope UI (.tsk-* namespace, split from _tasks.css):
   the workload strip (one chip per member, click = scope the board) and
   the person picker dropdown with its member search. Card/board styles
   live in _tasks.css, the create modal in _tasks_modal.css.
   ══════════════════════════════════════════════════════════════════ */

/* ── Team workload strip (between toolbar and board) ───────────────
   One chip per member: avatar · name · overdue/today/upcoming counts ·
   stacked distribution bar. Click scopes the board to that person; the
   active chip gets the accent ring; idle members ("frei") are dimmed. */
.tsk-team {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.tsk-team-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 170px;
    padding: 10px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                transform var(--transition-fast), box-shadow var(--transition-fast);
}
.tsk-team-chip:hover {
    background: var(--bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
}
.tsk-team-chip.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--accent-glow);
}
.tsk-team-chip.is-idle { opacity: 0.55; }
.tsk-team-chip.is-idle:hover { opacity: 0.85; }
.tsk-team-chip .tsk-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.6875rem;
}
.tsk-team-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.tsk-team-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tsk-team-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}
.tsk-team-free {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
}
.tsk-team-counts {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
}
.tsk-tc { display: inline-flex; align-items: center; gap: 4px; }
.tsk-tc::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}
.tsk-tc--overdue  { color: var(--danger); }
.tsk-tc--today    { color: var(--warning); }
.tsk-tc--upcoming { color: var(--text-secondary); }
.tsk-tc.is-zero   { opacity: 0.35; }

.tsk-team-bar {
    display: flex;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}
.tsk-team-seg { height: 100%; transition: width var(--transition-fast); }
.tsk-team-seg--overdue  { background: var(--danger); }
.tsk-team-seg--today    { background: var(--warning); }
.tsk-team-seg--upcoming { background: rgba(148, 163, 184, 0.55); }


/* ── Person picker (toolbar) — calendar-userpick pattern, .tsk-scoped ── */
.tsk-ownerpick { position: relative; }
.tsk-ownerpick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), border-color var(--transition-fast),
                background var(--transition-fast);
}
.tsk-ownerpick-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
/* A non-default scope must be visible at a glance — accent ring like an
   active filter, so nobody mistakes one person's board for the whole team. */
.tsk-ownerpick-btn.is-filtered {
    color: var(--text-accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 2px 12px var(--accent-glow);
}
.tsk-ownerpick-ico { display: inline-flex; }
.tsk-ownerpick-ico svg { width: 14px; height: 14px; display: block; }
.tsk-ownerpick-caret { font-size: 0.7rem; opacity: 0.7; }

/* No full-screen backdrop here: a fixed inset-0 layer would swallow wheel
   events and freeze page scrolling while the menu is open — outside clicks
   close via a window mousedown listener in picker.rs instead. */
.tsk-ownerpick-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1100;
    min-width: 240px;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    background: var(--glass-bg-heavy, rgba(15, 20, 34, 0.96));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
}
.tsk-ownerpick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.tsk-ownerpick-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tsk-ownerpick-item.is-active { background: var(--accent-soft); color: var(--text-accent); }
.tsk-ownerpick-sep { height: 1px; margin: 6px 4px; background: var(--glass-border-subtle); }
.tsk-ownerpick-empty {
    padding: 12px 10px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

/* Member search head of the dropdown: magnifier + borderless input on a
   subtle inset field, separated from the list below. */
.tsk-ownerpick-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 2px 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tsk-ownerpick-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}
.tsk-ownerpick-search-ico { display: inline-flex; color: var(--text-muted); flex-shrink: 0; }
.tsk-ownerpick-search-ico svg { width: 14px; height: 14px; display: block; }
.tsk-ownerpick-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    outline: none;
}
.tsk-ownerpick-search-input::placeholder { color: var(--text-muted); }


/* ══════════════════════════════════════════════════════════════════
   Aufgaben — create-task modal (.tsk-* namespace, split from _tasks.css):
   overlay/dialog anatomy, form fields, priority chips, and the
   contact/company link search. Board styles live in _tasks.css, the
   team strip + person picker in _tasks_team.css.
   ══════════════════════════════════════════════════════════════════ */

/* ── Create-task modal ─────────────────────────────────────────────
   Same overlay/head/body/actions anatomy as the dashboard's .wc-modal,
   .tsk-scoped. The body scrolls, the footer stays pinned. */
.tsk-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 7, 14, 0.62);
    backdrop-filter: blur(6px);
}
.tsk-modal {
    display: flex;
    flex-direction: column;
    width: min(560px, 94vw);
    max-height: 86vh;
    background: var(--glass-bg-heavy, rgba(15, 20, 34, 0.97));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    animation: tsk-modal-in 160ms ease-out;
}
@keyframes tsk-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tsk-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border-subtle);
}
.tsk-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.tsk-modal-x {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tsk-modal-x:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.45); }

.tsk-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    overflow-y: auto;
    /* Link-search results auto-scroll into view (modal_link.rs) — glide,
       don't jump. */
    scroll-behavior: smooth;
}

/* Fields: stacked label + control; rows split into equal columns. */
.tsk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tsk-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tsk-field-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.tsk-field-input {
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tsk-field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}
.tsk-field-input::placeholder { color: var(--text-muted); }
.tsk-field-textarea { resize: vertical; min-height: 72px; }
.tsk-field-select { appearance: auto; cursor: pointer; }
/* Dark theme for the native date/time picker glyphs. */
.tsk-field-input[type="date"], .tsk-field-input[type="time"] { color-scheme: dark; }

/* Priority: one chip per level, reusing the card badges' colour rules
   (.tsk-prio--*); the picked chip lights up via outline + full opacity. */
.tsk-prio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tsk-prio-choice {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity var(--transition-fast), transform var(--transition-fast),
                box-shadow var(--transition-fast);
}
.tsk-prio-choice:hover { opacity: 0.85; }
.tsk-prio-choice.is-active {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 0 0 1.5px currentColor;
}

.tsk-modal-error {
    padding: 10px 12px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: var(--radius-md);
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    font-size: 0.8125rem;
}

.tsk-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--glass-border-subtle);
}
.tsk-modal-btn {
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
                transform var(--transition-fast);
}
.tsk-modal-btn--ghost {
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
}
.tsk-modal-btn--ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.tsk-modal-btn--primary {
    border: none;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}
.tsk-modal-btn--primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.tsk-modal-btn--primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ── Link picker inside the modal (contact/company via global search) ── */
.tsk-link-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.25);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tsk-link-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}
.tsk-link-search-ico { display: inline-flex; color: var(--text-muted); flex-shrink: 0; }
.tsk-link-search-ico svg { width: 14px; height: 14px; display: block; }
.tsk-link-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
}
.tsk-link-search-input::placeholder { color: var(--text-muted); }

.tsk-link-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 6px;
    padding: 4px;
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
}
.tsk-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.tsk-link-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tsk-link-item-ico { display: inline-flex; flex-shrink: 0; color: var(--text-muted); }
.tsk-link-item-ico svg { width: 13px; height: 13px; display: block; }
.tsk-link-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-link-item-sub {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.6875rem;
    white-space: nowrap;
}
.tsk-link-empty {
    margin-top: 6px;
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

/* Linked entity chip (replaces the search until unlinked). */
.tsk-linkchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--text-accent);
    font-size: 0.8125rem;
    font-weight: 600;
    align-self: flex-start;
}
.tsk-linkchip-ico { display: inline-flex; flex-shrink: 0; }
.tsk-linkchip-ico svg { width: 13px; height: 13px; display: block; }
.tsk-linkchip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-linkchip-x {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-accent);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.tsk-linkchip-x:hover { background: rgba(248, 113, 113, 0.18); color: var(--danger); }

/* ── Pipeline board: stage-member cards (contacts/companies without a deal) ──
   Deals bleiben die "vollen" Karten; Member-Karten tragen einen Entity-Badge
   und einen dezenten Akzentstreifen, damit beide Typen unterscheidbar sind. */

.pl-card--member {
    border-left: 2px solid var(--accent, #818cf8);
}

.pl-member-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent, #818cf8);
    background: color-mix(in srgb, var(--accent, #818cf8) 14%, transparent);
    vertical-align: middle;
    white-space: nowrap;
}

.pl-card--list .pl-member-badge {
    margin-left: auto;
}

/* ── Standalone calendar page ─────────────────────────────────── */
/* Full-height page: turn the scroll shell into a fill-flex column (scoped via
   :has() so only the calendar page is affected) and trim the top padding so the
   agenda uses the whole viewport — toolbar hugs the top, grid reaches the very
   bottom edge. Mirrors the pipeline board's `.app-main:has(.pl-board)` pattern. */
.app-main:has(.cal-grid) {
    display: flex; flex-direction: column; min-height: 0;
    padding-top: 8px; padding-bottom: var(--space-sm);
}
.cal-toolbar {
    display: flex; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-sm); flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-today-btn {
    padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
    background: var(--glass-bg); color: var(--text-primary); font-size: 0.8125rem;
    font-weight: 600; cursor: pointer; transition: all var(--transition-fast);
}
.cal-today-btn:hover { background: var(--bg-hover); }

/* Segmented view switch */
.cal-viewswitch {
    display: flex; gap: 4px; padding: 4px; border-radius: 12px;
    background: rgba(0, 25, 47, 0.55); border: 1px solid var(--glass-border);
}
.cal-vbtn {
    padding: 6px 14px; border: none; border-radius: 9px; background: transparent;
    color: var(--text-secondary); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition-fast); white-space: nowrap;
}
.cal-vbtn:hover { color: var(--text-primary); }
.cal-vbtn.active { background: #00284b; color: #fff; }

/* User picker */
.cal-userpick { position: relative; margin-left: auto; }
.cal-userpick-btn {
    display: flex; align-items: center; gap: 8px; padding: 7px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
    background: var(--glass-bg); color: var(--text-primary); font-size: 0.8125rem;
    font-weight: 600; cursor: pointer; transition: all var(--transition-fast);
}
.cal-userpick-btn:hover { border-color: var(--glass-border-hover); }
.cal-userpick-caret { color: var(--text-muted); font-size: 0.85rem; }
.cal-userpick-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 100; min-width: 220px;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 6px; max-height: 320px; overflow-y: auto;
}
.cal-userpick-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: none;
    border-radius: var(--radius-sm); background: transparent; color: var(--text-primary);
    font-size: 0.8125rem; cursor: pointer; transition: background var(--transition-fast);
}
.cal-userpick-item:hover { background: var(--bg-hover); }

/* Grid — vertical stack (headrow · all-day lane · scrollable body) that grows
   to fill the page height. `display:flex; flex-direction:column` is explicit so
   the sections always stack even if another page defines a `.cal-*` grid. */
.cal-grid {
    padding: 0; overflow: hidden;
    display: flex; flex-direction: column;
    flex: 1 1 auto; min-height: 0;
}
.cal-headrow {
    display: flex; border-bottom: 1px solid var(--glass-border);
}
.cal-time-spacer { width: 52px; flex-shrink: 0; }
.cal-dayhead {
    flex: 1; min-width: 0; padding: 8px 4px 7px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border-left: 1px solid var(--glass-border-subtle);
}
.cal-dayhead-wd {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
}
.cal-dayhead-num {
    display: flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px;
    font-size: 1.125rem; font-weight: 700; color: var(--text-primary); line-height: 1;
}
.cal-dayhead.today .cal-dayhead-wd { color: var(--accent-hover); }
.cal-dayhead.today .cal-dayhead-num { background: var(--accent); color: #fff; }
.cal-dayhead.weekend { background: rgba(255, 255, 255, 0.012); }
.cal-dayhead.weekend .cal-dayhead-num { color: var(--text-secondary); }

/* All-day lane */
.cal-allday {
    display: flex; border-bottom: 1px solid var(--glass-border);
    min-height: 30px; background: rgba(255, 255, 255, 0.008);
}
.cal-allday-label {
    width: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end;
    padding-right: 6px; font-size: 0.5625rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--text-muted);
}
.cal-allday-cell {
    flex: 1; min-width: 0; border-left: 1px solid var(--glass-border-subtle);
    padding: 3px 4px; display: flex; flex-direction: column; gap: 3px;
}
.cal-allday-chip {
    font-size: 0.6875rem; font-weight: 600; color: var(--text-primary);
    padding: 2px 7px; border-radius: 4px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: filter var(--transition-fast);
}
.cal-allday-chip:hover { filter: brightness(1.15); }

.cal-scroll {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin;
}
.cal-body { display: flex; position: relative; }
.cal-timerail { width: 52px; flex-shrink: 0; }
.cal-trow {
    height: 48px; box-sizing: border-box; display: flex; justify-content: flex-end;
    padding-right: 6px; align-items: flex-start;
}
.cal-trow .cp-cal-time { font-size: 0.6875rem; color: var(--text-muted); transform: translateY(-7px); }

.cal-col {
    flex: 1; min-width: 0; position: relative;
    border-left: 1px solid var(--glass-border-subtle); user-select: none;
}
.cal-col.weekend { background: rgba(255, 255, 255, 0.012); }
.cal-cell {
    height: 48px; box-sizing: border-box; position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* faint half-hour divider at the vertical middle */
    background-image: linear-gradient(to bottom,
        transparent calc(50% - 0.5px), rgba(255, 255, 255, 0.022) calc(50% - 0.5px),
        rgba(255, 255, 255, 0.022) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.cal-cell:hover::after {
    content: "+"; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 600; color: var(--text-muted);
    background: rgba(99, 102, 241, 0.05); opacity: 0.55; pointer-events: none;
}

/* Event chip (Outlook-style) — left/width set inline for overlap columns */
.cal-event {
    position: absolute; box-sizing: border-box;
    border-radius: 5px; padding: 3px 7px; overflow: hidden; cursor: grab;
    display: flex; flex-direction: column; gap: 1px; z-index: 2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: filter var(--transition-fast), box-shadow var(--transition-fast);
}
.cal-event:hover { filter: brightness(1.12); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); z-index: 6; }
.cal-event:active { cursor: grabbing; }
.cal-event-title {
    font-size: 0.75rem; font-weight: 700; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
    /* Reserve room for the status circle (top-right) so the title truncates
       cleanly BEFORE it — no „…" running under the circle. */
    padding-right: 20px;
}
.cal-event-time { font-size: 0.625rem; color: var(--text-secondary); pointer-events: none; }
.cal-event-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-event-resize:hover { background: rgba(255, 255, 255, 0.18); }
.cal-event.provisional {
    left: 2px !important; right: 2px; width: auto !important;
    background: rgba(99, 102, 241, 0.25); border: 1px dashed var(--accent);
    pointer-events: none; box-shadow: none;
}

/* ── Termin-Ausgang-Kreis (Linksklick=erschienen, Rechtsklick=Menü) ── */
.cal-event-status {
    position: absolute; top: 4px; right: 5px;
    width: 15px; height: 15px; padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.18);
    color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    z-index: 5;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.cal-event-status:hover { border-color: #fff; transform: scale(1.12); }
.cal-event-status-ico { display: flex; }
.cal-event-status-ico svg { width: 10px; height: 10px; }
.cal-event-status-done { background: #34d399; border-color: #34d399; color: #06281c; }
.cal-event-status-noshow { background: #fbbf24; border-color: #fbbf24; }
.cal-event-status-cancelled { background: #f87171; border-color: #f87171; }

/* ── Rechtsklick-Ausgang-Menü ── */
.cal-status-menu-backdrop { position: fixed; inset: 0; z-index: 9999; }
.cal-status-menu {
    position: fixed; min-width: 158px; padding: 5px;
    background: #161b2b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
    display: flex; flex-direction: column; gap: 2px;
}
.cal-status-menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px;
    border: none; background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem; font-weight: 500;
    text-align: left; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.cal-status-menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.cal-status-menu-item::before {
    content: ""; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.cal-status-menu-item-done::before { background: #34d399; }
.cal-status-menu-item-noshow::before { background: #fbbf24; }
.cal-status-menu-item-cancelled::before { background: #f87171; }
.cal-status-menu-item-open::before {
    background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.45);
}

/* Current-time indicator (Outlook red line) */
.cal-nowline {
    position: absolute; left: 0; right: 0; height: 0;
    border-top: 2px solid #ef4444; z-index: 7; pointer-events: none;
}
.cal-nowline-dot {
    position: absolute; left: -1px; top: -5px; width: 9px; height: 9px;
    border-radius: 50%; background: #ef4444;
}

/* Create/edit modal */
.cal-modal-backdrop {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(0, 0, 0, 0.2); display: flex; align-items: center; justify-content: center;
    /* no backdrop blur — the calendar behind stays sharp (Outlook-style) */
}
.cal-modal {
    width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--space-sm);
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-md);
}
.cal-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}

/* Meeting-link readout (detail popup + modal link row) */
.cal-link {
    flex: 1; min-width: 0; font-size: 0.8125rem; color: var(--accent-hover);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.cal-link:hover { text-decoration: underline; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
    border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--glass-border);
    font-size: 0.75rem; color: var(--text-primary);
}
.cal-chip-x {
    border: none; background: rgba(255, 255, 255, 0.08); color: var(--text-muted);
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem;
}
.cal-chip-x:hover { background: var(--danger); color: #fff; }
.cal-contact-search { position: relative; }
.cal-contact-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px;
    max-height: 200px; overflow-y: auto;
}
.cal-contact-item {
    display: block; width: 100%; text-align: left; padding: 7px 10px; border: none;
    border-radius: var(--radius-sm); background: transparent; color: var(--text-primary);
    font-size: 0.8125rem; cursor: pointer;
}
.cal-contact-item:hover { background: var(--bg-hover); }

/* ── Modal polish (create/edit) ─────────────────────────────── */
.cal-icon-btn {
    width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 8px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.cal-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.cal-icon-btn svg { width: 17px; height: 17px; }
.cal-modal-title-h { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); }
/* Borderless Outlook-style title — bottom hairline only */
.cal-modal-title-input {
    width: 100%; box-sizing: border-box; padding: 6px 2px 9px; font-size: 1.25rem; font-weight: 700;
    color: var(--text-primary); background: transparent;
    border: none; border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-sans); outline: none; transition: border-color var(--transition-fast);
}
.cal-modal-title-input:focus { border-bottom-color: var(--accent); }
.cal-modal-title-input::placeholder { color: var(--text-muted); font-weight: 600; }
.cal-field { display: flex; align-items: center; gap: 12px; }
.cal-field-ic { flex-shrink: 0; color: var(--text-muted); display: flex; width: 18px; justify-content: center; }
.cal-field-ic svg { width: 17px; height: 17px; }
.cal-field-grow { flex: 1; min-width: 0; }

/* ── Wide Outlook-compose modal (borderless rows, icon gutter) ── */
.cal-modal-wide {
    width: 600px; max-width: calc(100vw - 32px);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    gap: 14px;
}
/* Top-align the icon gutter for multi-line rows (chips, swatches, notes) */
.cal-field-top { align-items: flex-start; }
.cal-field-top .cal-field-ic { margin-top: 5px; }
.cal-stack { display: flex; flex-direction: column; gap: 8px; }
/* Horizontal "when" row — toggle + date + time inline → grows wide, not tall */
.cal-when { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cal-times { display: flex; align-items: center; gap: 8px; }
.cal-field-link { margin-top: -6px; }
.cal-field-link .cal-link { font-size: 0.8125rem; }

/* Borderless underline inputs (the Outlook signature) */
.cal-uline {
    width: 100%; box-sizing: border-box; padding: 6px 2px; font-size: 0.9rem;
    color: var(--text-primary); background: transparent; color-scheme: dark;
    border: none; border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-sans); outline: none;
    transition: border-color var(--transition-fast);
}
.cal-uline:focus { border-bottom-color: var(--accent); }
.cal-uline::placeholder { color: var(--text-muted); }
.cal-uline:disabled { color: var(--text-secondary); opacity: 0.8; }
.cal-uline-date { width: auto; flex: 0 1 auto; }
.cal-uline-time { width: auto; flex: 0 0 92px; }
select.cal-uline { cursor: pointer; }
select.cal-uline option { background: var(--glass-bg-solid); color: var(--text-primary); }
.cal-uline-notes {
    width: 100%; box-sizing: border-box; padding: 6px 2px; font-size: 0.9rem; line-height: 1.5;
    color: var(--text-primary); background: transparent;
    border: none; border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-sans); outline: none; resize: vertical;
    min-height: 46px; max-height: 140px;
    transition: border-color var(--transition-fast);
}
.cal-uline-notes:focus { border-bottom-color: var(--accent); }
.cal-uline-notes::placeholder { color: var(--text-muted); }

/* iOS-style toggle switch */
.cal-switch-wrap { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; flex-shrink: 0; }
.cal-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.cal-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cal-switch-knob {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--bg-hover); border: 1px solid var(--glass-border);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.cal-switch-knob::before {
    content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--text-secondary);
    transition: transform var(--transition-fast), background var(--transition-fast);
}
.cal-switch input:checked + .cal-switch-knob { background: var(--accent); border-color: transparent; }
.cal-switch input:checked + .cal-switch-knob::before { transform: translateX(16px); background: #fff; }
.cal-switch input:disabled + .cal-switch-knob { opacity: 0.5; }
.cal-switch-lbl { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

/* Footer separator for the wide modal */
.cal-modal-foot { margin-top: 6px; padding-top: var(--space-md); border-top: 1px solid var(--glass-border); }

/* Narrow viewports: let the wide card shrink gracefully */
@media (max-width: 620px) {
    .cal-modal-wide { width: 100%; padding: var(--space-md); }
    .cal-when { gap: 10px; }
}

/* ── Event detail (peek) popup ──────────────────────────────── */
.cal-detail {
    width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow-y: auto;
    display: flex; flex-direction: column;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.cal-detail-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 14px 14px 12px;
}
.cal-detail-titlewrap { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.cal-detail-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.cal-detail-title { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.cal-detail-acts { display: flex; gap: 2px; flex-shrink: 0; }
.cal-detail-body {
    display: flex; flex-direction: column; gap: 14px;
    padding: 14px 16px 16px; border-top: 1px solid var(--glass-border);
}
.cal-detail-row { display: flex; align-items: center; gap: 11px; }
.cal-detail-ic { flex-shrink: 0; color: var(--text-muted); display: flex; width: 16px; justify-content: center; }
.cal-detail-ic svg { width: 16px; height: 16px; }
.cal-detail-when { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.cal-detail-sub { font-size: 0.8125rem; color: var(--text-secondary); }
.cal-detail-badge { font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.cal-detail-join {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
    padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none;
    background: var(--accent); color: #fff; font-size: 0.8125rem; font-weight: 600;
    transition: filter var(--transition-fast);
}
.cal-detail-join:hover { filter: brightness(1.1); }
.cal-detail-join svg { width: 15px; height: 15px; }
.cal-detail-sec { display: flex; flex-direction: column; gap: 7px; }
.cal-detail-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.6875rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.cal-detail-label svg { width: 13px; height: 13px; }
.cal-detail-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-detail-att {
    display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
    background: var(--bg-hover); border: 1px solid var(--glass-border);
    font-size: 0.75rem; font-weight: 500; color: var(--text-primary); text-decoration: none;
    transition: all var(--transition-fast);
}
.cal-detail-att:hover { border-color: var(--accent); color: var(--accent-hover); }
.cal-detail-profile {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
    font-size: 0.8125rem; font-weight: 600; color: var(--accent-hover); text-decoration: none;
}
.cal-detail-profile:hover { text-decoration: underline; }
.cal-detail-profile svg { width: 15px; height: 15px; }
.cal-detail-notes {
    margin: 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap;
}
.cal-detail-ai-btn {
    align-self: flex-start; padding: 7px 13px; border-radius: var(--radius-sm);
    border: 1px dashed var(--glass-border-hover); background: var(--accent-soft);
    color: var(--accent-hover); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
    transition: background var(--transition-fast);
}
.cal-detail-ai-btn:hover { background: rgba(99, 102, 241, 0.18); }
.cal-detail-ai-status { margin: 0; font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }
.cal-detail-ai-text {
    margin: 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.55; white-space: pre-wrap;
    background: rgba(99, 102, 241, 0.07); border-left: 2px solid var(--accent);
    padding: 9px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.cal-detail-del {
    display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
    padding: 7px 12px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    background: rgba(248, 113, 113, 0.12); color: var(--danger);
    font-size: 0.8125rem; font-weight: 600; transition: background var(--transition-fast);
}
.cal-detail-del:hover { background: rgba(248, 113, 113, 0.2); }
.cal-detail-del svg { width: 14px; height: 14px; }

/* Calendar & Contact Profile */

.cp-back-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.cp-back-btn svg { width: 16px; height: 16px; }

/* ── Pipeline bar inside the top header (transparent, fills the slot) ── */
.cp-topbar-inner {
    display: flex; align-items: center; gap: var(--space-md);
    width: 100%; min-width: 0;
}
.cp-topbar-inner > .cp-back-btn,
.cp-topbar-inner > .cp-outcome-btns { flex-shrink: 0; }

/* All header controls share one height + glass box (Zurück · Pipeline · Lupe) */
.cp-topbar-inner .cp-back-btn {
    height: 40px; padding: 0 var(--space-lg);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 15px;
}
.cp-topbar-inner .cp-pill-track {
    height: 40px; position: relative; overflow: hidden;
    background: var(--glass-bg); border-color: var(--glass-border);
}

/* ── Pipeline Pill Area ────────────────────────────────────── */
.cp-pills-area {
    flex: 1; display: flex; flex-direction: column; gap: 6px;
    min-width: 0;
}
.cp-pill-row {
    display: flex; align-items: center; gap: var(--space-sm);
}
.cp-pill-label {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    white-space: nowrap; min-width: 80px;
}
.cp-pill-track {
    display: flex; flex: 1; overflow: hidden;
    border-radius: var(--radius-full);
    border: 1px solid rgba(100, 116, 139, 0.12);
}
/* Progress fill inside the bordered pill (shows how far in the pipeline).
   Tinted with the tenant's selected accent (--accent) via color-mix, keeping the
   translucent gradient + glow so the glass pill still reads through it. */
.cp-pill-fill {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--accent) 45%, transparent),
        color-mix(in srgb, var(--accent) 68%, transparent));
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 30%, transparent);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.cp-pill-stages {
    position: relative; z-index: 1; flex: 1; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-lg);
}
.cp-pill-seg {
    padding: 0 6px; font-size: 0.8125rem; font-weight: 600;
    background: transparent; color: var(--text-muted); border: none;
    cursor: pointer; transition: color 0.18s ease;
    white-space: nowrap; flex-shrink: 0;
}
.cp-pill-seg:hover { color: var(--text-primary); }
/* Read-only (kein contacts:/companies:write): Pill ist reine Fortschrittsanzeige. */
.cp-pill-seg:disabled { cursor: default; }
.cp-pill-seg:disabled:hover { color: var(--text-muted); }
.cp-pill-seg.past:disabled:hover { color: rgba(255, 255, 255, 0.92); }
.cp-pill-seg.active:disabled:hover { color: #fff; }
.cp-pill-seg.past { color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.cp-pill-seg.active { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.45); }
/* Faint chevron between stages (›) */
.cp-pill-sep {
    color: rgba(255, 255, 255, 0.45); flex-shrink: 0;
    font-size: 1rem; padding: 0 1px; user-select: none;
}

.cp-outcome-btns { display: flex; gap: var(--space-sm); flex-shrink: 0; }
.cp-won-btn, .cp-lost-btn {
    padding: 8px var(--space-lg); border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 600; border: none; cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-won-btn { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.cp-won-btn:hover { background: rgba(34, 197, 94, 0.3); }
.cp-lost-btn { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.cp-lost-btn:hover { background: rgba(248, 113, 113, 0.3); }

/* ── Floating search pill (pipeline bar) ───────────────────────
   Collapsed: just the magnifier, no background (floating).
   Open: expands to a field; the pipeline (flex:1) shrinks in sync.
   Width transition drives both movements as one animation.        */
.cp-search-pill {
    flex-shrink: 0; display: flex; align-items: center;
    width: 40px; height: 40px; overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.32s ease;
}
.cp-search-pill.open {
    width: 360px;
    border-color: var(--glass-border-hover);
}
.cp-search-input {
    flex: 1; min-width: 0;
    background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-sans);
    font-size: 0.875rem; padding: 0;
    opacity: 0; transition: opacity 0.22s ease 0.06s, padding 0.28s ease;
}
/* Collapsed: no padding so the magnifier isn't pushed out / clipped */
.cp-search-pill.open .cp-search-input {
    opacity: 1; padding: 0 var(--space-sm) 0 var(--space-md);
}
.cp-search-input::placeholder { color: var(--text-muted); }
.cp-search-icon {
    flex-shrink: 0; width: 40px; height: 40px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); transition: color 0.2s ease;
}
.cp-search-icon:hover { color: var(--text-primary); }
.cp-search-icon svg { width: 18px; height: 18px; }

/* Search results dropdown (wired to /api/v1/search) */
.cp-search { position: relative; flex-shrink: 0; }
.cp-search-results {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; max-height: 60vh; overflow-y: auto;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-xs);
    box-shadow: var(--shadow-lg); z-index: 200;
}
.cp-search-group {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); padding: 8px 10px 4px;
}
.cp-search-item {
    display: flex; flex-direction: column; gap: 1px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text-primary); text-decoration: none;
    font-size: 0.85rem; transition: background 0.15s;
}
.cp-search-item:hover { background: var(--bg-hover); }
.cp-search-item small { color: var(--text-muted); font-size: 0.72rem; }
.cp-search-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* ── Two-Column Layout ──────────────────────────────────────── */
.cp-layout { display: flex; gap: var(--space-sm); align-items: flex-start; height: calc(100vh - 120px); }
.cp-left {
    width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-sm);
    position: sticky; top: 0; max-height: calc(100vh - 120px);
    overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.cp-left::-webkit-scrollbar { display: none; }
.cp-unified-layout { display: flex; flex-direction: column; gap: 11px; }
.cp-right {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    position: sticky; top: 0; max-height: calc(100vh - 120px);
}

/* ── Right Column: tabs · collapsing editor box · scrollable body ───── */
.cp-right > .cp-tabs { flex-shrink: 0; margin-bottom: var(--space-sm); }

/* Editor/action box: hides on scroll-down, reveals on scroll-up. One eased
   transition per toggle — smooth, no per-scroll-tick reflow. */
.cp-right-editor {
    flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-sm);
    overflow: hidden;
    max-height: 640px; opacity: 1; transform: translateY(0);
    transition: max-height 0.34s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease, transform 0.34s ease, margin 0.34s ease;
    will-change: max-height, opacity, transform;
}
.cp-right-editor.collapsed {
    max-height: 0; opacity: 0; transform: translateY(-10px);
    margin: 0; pointer-events: none;
}
.cp-right-body {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
    gap: var(--space-sm); padding-top: var(--space-sm);
    scrollbar-width: none; -ms-overflow-style: none;
}
.cp-right-body::-webkit-scrollbar { display: none; }

/* ── E-Mail Composer (Figma: Selly Email.svg) ──────────────────
   A centred column of floating rounded fields on the editor card:
   To · Betreff (each with a trailing square action), then a body
   block with the send button docked bottom-right inside it. */
.cp-note-editor.cp-mail {
    padding: 0;
    min-height: 0;
}
.cp-mail-body {
    width: 56%;
    max-width: 540px;
    margin: 18px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* An / Betreff — a floating rounded field + trailing square action. */
.cp-mail-row { display: flex; align-items: stretch; gap: 8px; }
.cp-mail-field {
    flex: 1; min-width: 0;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 11px 15px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.cp-mail-field::placeholder { color: var(--text-muted); }
.cp-mail-field:focus {
    background: var(--bg-elevated);
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Trailing square button (recipient chevron / template icon). */
.cp-mail-sq {
    flex: 0 0 auto;
    width: 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
}
.cp-mail-sq:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
    border-color: var(--glass-border-hover);
}
.cp-mail-sq svg { width: 15px; height: 15px; display: block; }
/* Template tools in the Betreff row: the .cp-tpl-wrap wrappers dissolve
   (display:contents) so the squares become row flex items and stretch like
   the other squares; the "Als Vorlage speichern" popover then anchors to the
   row itself and opens right below it. */
.cp-mail-row { position: relative; }
.cp-mail-row .cp-tpl-wrap { display: contents; }
.cp-mail-row .cp-tpl-save { top: calc(100% + 6px); right: 0; }
.cp-mail-sq.open {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--glass-border-hover);
}
.cp-mail-sq.flash-ok { color: #22c55e; background: rgba(34, 197, 94, 0.12); }

/* Company: the square hosts a real <select> (native arrow hidden, chevron shown). */
.cp-mail-sel { position: relative; }
.cp-mail-sel select {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none; border: none;
}

/* Body block — rounded panel with send docked bottom-right inside it. */
.cp-mail-editor {
    position: relative;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cp-mail-editor:focus-within {
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.cp-mail-textarea {
    width: 100%; box-sizing: border-box;
    min-height: 160px; max-height: 300px;
    padding: 13px 15px 50px;
    background: transparent;
    border: none; outline: none; resize: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.55;
    text-align: left;
}
.cp-mail-textarea::placeholder { color: var(--text-muted); }

/* Actions: status + circular send, bottom-right inside the body block. */
.cp-mail-actions {
    position: absolute; right: 10px; bottom: 10px;
    display: flex; align-items: center; gap: 10px;
}
.cp-mail-send {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    border: none; cursor: pointer;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: all 0.18s ease;
}
.cp-mail-send:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.cp-mail-send:active { transform: translateY(0); }
.cp-mail-send:disabled { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }
.cp-mail-send svg { width: 15px; height: 15px; display: block; }

/* Status message (reused by the composer). */
.cp-email-status { font-size: 0.72rem; white-space: nowrap; animation: fadeIn 0.3s ease; }
.cp-email-status.ok { color: var(--success); }
.cp-email-status.err { color: var(--danger); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }


/* ── Typisierte Custom-Field-Inputs: Einheiten-Suffix + Wrapper ── */
.cp-cf-wrap { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex: 1; }
.cp-cf-wrap .cp-cf-input { flex: 1; min-width: 0; }
.cp-cf-unit {
    color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap;
    flex-shrink: 0;
}
.cp-cf-select { cursor: pointer; }
.cp-cf-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* fx marker on computed (formula) fields — read-only by design. */
.cp-cf-fx { display: inline-flex; color: var(--text-muted); flex-shrink: 0; }
.cp-cf-fx svg { width: 12px; height: 12px; }

/* ── Call Panel (SVG Board — boardanrufbereich.svg) ───────── */
.cp-call-panel {
    display: flex; flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    position: relative;
}

/* Centered cluster: 390px max, matches SVG inner boxes        */
.cp-call-center {
    width: 100%; max-width: 390px;
    display: flex; flex-direction: column; gap: 9px;
}

/* Box base: subtle glass on dark, clearly visible             */
.cp-call-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.cp-call-box:hover { background: rgba(255, 255, 255, 0.09); }

/* Row 1: Phone number selector — 390×80 in SVG               */
.cp-call-phone-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    position: relative; cursor: pointer;
    min-height: 56px;
}
.cp-call-selected-number {
    display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0;
}
.cp-call-label {
    font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.cp-call-num {
    font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
    font-family: var(--font-sans); letter-spacing: 0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-call-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    border: 1.5px solid rgba(34, 197, 94, 0.25);
    display: flex; align-items: center; justify-content: center;
    color: var(--success); flex-shrink: 0;
}
.cp-call-chevron {
    color: var(--text-muted); flex-shrink: 0;
    transition: transform 0.2s;
}

/* Dropdown */
.cp-call-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 4px; z-index: 100;
    background: rgba(0, 17, 32, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px; padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    animation: fadeSlideDown 0.15s ease;
}
.cp-call-dropdown-item {
    width: 100%; display: flex; flex-direction: column; gap: 1px;
    padding: 8px 14px; border: none; border-radius: 12px;
    background: transparent; color: var(--text-primary);
    cursor: pointer; text-align: left; transition: background 0.15s;
}
.cp-call-dropdown-item:hover { background: rgba(99, 102, 241, 0.1); }

/* Row 2: Timer — 390×80 in SVG, centered text                */
.cp-call-timer {
    text-align: center; font-size: 1.75rem; font-weight: 700;
    color: var(--text-muted); font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em; padding: 16px 16px;
    min-height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.cp-call-timer.active {
    color: var(--success);
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    background: rgba(0, 17, 32, 0.55);
}

/* Row 3: Buttons — 2× 193×42, 4px gap, total 390px           */
.cp-call-bottom-row {
    display: flex; gap: 4px;
}
.cp-call-action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 12px; border-radius: 20px; min-height: 42px;
    font-size: 0.8125rem; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.25s;
}
.cp-call-action-btn svg { width: 16px; height: 16px; }
.cp-call-action-btn.call {
    background: rgba(0, 17, 32, 0.4);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}
.cp-call-action-btn.call:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
}
.cp-call-action-btn.call:disabled {
    opacity: 0.35; cursor: not-allowed;
}
.cp-call-action-btn.hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
    animation: pulseRed 2s infinite;
}
.cp-call-action-btn.hangup:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.45);
}
@keyframes pulseRed {
    0%, 100% { box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3); }
    50%      { box-shadow: 0 2px 20px rgba(239, 68, 68, 0.5); }
}
.cp-call-fullscreen-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 12px; border-radius: 20px; min-height: 42px;
    background: rgba(0, 17, 32, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: var(--text-muted); font-size: 0.8125rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.cp-call-fullscreen-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent);
}

/* Status */
.cp-call-status {
    text-align: center; font-size: 0.75rem; font-weight: 500;
    padding: 6px 12px; border-radius: 20px;
    max-width: 390px; width: 100%;
    animation: fadeIn 0.3s ease;
}
.cp-call-status.ok  { color: var(--success); background: rgba(34, 197, 94, 0.08); }
.cp-call-status.err { color: #ef4444;        background: rgba(239, 68, 68, 0.08); }

.gp-spinner-sm {
    width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}


/* Contact/Company profile — feed cards: note · communication (call/email) · appointment */
/* ── Note Cards (in feed) ──────────────────────────────────── */
.cp-note-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: var(--space-md);
    position: relative;
}
.cp-note-card-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.cp-note-pin {
    display: inline-block; font-size: 0.6875rem; font-weight: 600;
    color: var(--warning); background: rgba(251, 191, 36, 0.12);
    padding: 2px 8px; border-radius: var(--radius-full);
}
.cp-note-meta { font-size: 0.75rem; color: var(--text-muted); flex: 1; }
.cp-note-more {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); padding: 2px; display: flex;
    align-items: center; justify-content: center;
    margin-left: auto; flex-shrink: 0;
    opacity: 0.4; transition: opacity 0.15s;
}
.cp-note-card:hover .cp-note-more { opacity: 1; }
.cp-note-more:hover { color: var(--text-primary); }
.cp-note-content {
    font-size: 0.875rem; color: var(--text-primary); white-space: pre-wrap;
    margin-bottom: var(--space-xs);
}
.cp-note-expand {
    background: none; border: none; cursor: pointer;
    font-size: 0.75rem; color: var(--accent); padding: 0;
    transition: color 0.15s;
}
.cp-note-expand:hover { color: var(--accent-hover); }

/* ── Communication cards (call / email) in the feed ─────────────────── */
.cp-comm-head {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 0.8rem; color: var(--text-primary);
}
.cp-comm-ic { display: flex; }
.cp-comm-ic svg { width: 14px; height: 14px; }
.cp-comm-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 3px; }
.cp-comm-detail {
    margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--glass-border);
    display: flex; flex-direction: column; gap: 2px;
}
.cp-comm-body { white-space: pre-wrap; font-size: 0.82rem; color: var(--text-secondary); margin: 4px 0 0; }

/* ── Appointment Card (in feed) — click opens it in the Termin tab ── */
.cp-appt-card { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.cp-appt-card:hover { background: var(--bg-hover); }
.cp-appt-icon { display: flex; align-items: center; flex-shrink: 0; }
.cp-appt-icon svg { width: 15px; height: 15px; }
.cp-appt-title {
    flex: 1; font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-appt-card .cp-note-meta { flex: 0 0 auto; }
.cp-appt-when {
    display: flex; align-items: baseline; gap: var(--space-sm);
    margin-bottom: 2px;
}
.cp-appt-time { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.cp-appt-hint {
    margin-left: auto; font-size: 0.6875rem; color: var(--text-muted);
    opacity: 0; transition: opacity 0.15s;
}
.cp-appt-card:hover .cp-appt-hint { opacity: 1; }
.cp-appt-desc { margin-top: 4px; margin-bottom: 0; font-size: 0.8125rem; color: var(--text-secondary); }

/* ── Termin-Ausgang-Badge (aus der „Nächster Termin"-App-Triage) ── */
.cp-appt-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.cp-appt-status-ico { display: flex; }
.cp-appt-status-ico svg { width: 13px; height: 13px; }
.cp-appt-status-done {
    color: #34d399;
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.32);
}
.cp-appt-status-noshow {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.32);
}
.cp-appt-status-cancelled {
    color: #f87171;
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.32);
}
/* Abgesagt/No-Show visuell zurücknehmen */
.cp-appt-cancelled { opacity: 0.72; }
.cp-appt-cancelled .cp-appt-title { text-decoration: line-through; }
.cp-appt-noshow { opacity: 0.85; }


/* Contact/Company profile — avatar box · action-button row · expanding quick-action panel */
/* ── Avatar Box ─────────────────────────────────────────────── */
.cp-avatar-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 24px; padding: var(--space-lg);
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: var(--space-xs);
}
.cp-avatar {
    width: 88px; height: 88px; border-radius: 50%;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
}
.cp-customer-nr {
    font-size: 0.6875rem; font-weight: 600; color: var(--text-muted);
    letter-spacing: 0.05em;
}
.cp-name {
    font-size: 1.125rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.01em; line-height: 1.2;
}

/* ── Action card: round button row + expanding quick-action panel ── */
.cp-actions-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 24px; padding: var(--space-sm) var(--space-md);
}
.cp-actions {
    display: flex; gap: var(--space-sm); justify-content: space-between;
}
.cp-action-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition-fast);
    text-decoration: none; flex-shrink: 0;
    background: rgba(67, 77, 123, 0.55); color: var(--text-secondary);
}
.cp-action-btn:hover {
    background: var(--accent); color: white;
    transform: translateY(-2px); box-shadow: var(--shadow-glow);
}
.cp-action-btn svg { width: 18px; height: 18px; }
/* The icon rides inside a wrapping <span>: inline layout would drop the SVG
   onto the text baseline (icons sat 1.5–3px high) — flex-center the span so
   every glyph is dead centre in its 44px circle. */
.cp-action-btn > span {
    display: flex; align-items: center; justify-content: center;
}
.cp-action-btn.active { background: var(--accent); color: white; }

/* ── Quick-action: panel expands *inside* the action card ──────── */
.cp-qa-panel {
    max-height: 0; overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.cp-qa-panel.open { max-height: 560px; }
.cp-qa-call {
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
    display: flex; flex-direction: column; gap: var(--space-md);
}
.cp-qa-call-head { display: flex; align-items: center; gap: var(--space-sm); }
.cp-qa-call-icon {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(52, 211, 153, 0.15); color: var(--success);
}
.cp-qa-call-icon svg { width: 18px; height: 18px; }
.cp-qa-call-icon.live { animation: cpCallPulse 1.6s ease-in-out infinite; }
@keyframes cpCallPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
    50%      { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.cp-qa-call-num {
    font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
    word-break: break-all;
}
.cp-qa-call-timer {
    text-align: center; font-size: 1.75rem; font-weight: 700;
    font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
    color: var(--text-muted); padding: var(--space-sm) 0;
    background: rgba(0, 0, 0, 0.18); border-radius: var(--radius-md);
}
.cp-qa-call-timer.live { color: var(--text-primary); }
.cp-qa-call-actions { display: flex; gap: var(--space-sm); }
.cp-qa-mute {
    width: 52px; flex-shrink: 0; border-radius: var(--radius-full); border: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: rgba(67, 77, 123, 0.55); color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.cp-qa-mute:disabled { opacity: 0.4; cursor: not-allowed; }
.cp-qa-mute.on { background: var(--warning); color: #1a1a1a; }
.cp-qa-mute svg { width: 18px; height: 18px; }
.cp-qa-callbtn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 48px; border-radius: var(--radius-full); border: none; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; color: white;
    transition: all var(--transition-fast);
}
.cp-qa-callbtn svg { width: 18px; height: 18px; }
.cp-qa-callbtn.call { background: var(--success); }
.cp-qa-callbtn.hangup { background: var(--danger); }
.cp-qa-callbtn:hover:not(:disabled) { filter: brightness(1.08); }
.cp-qa-callbtn:disabled { opacity: 0.5; cursor: not-allowed; }


/* Contact/Company profile — quick-action calendar (Termin) day-agenda */
/* ── Quick-action calendar (Termin) — interactive day agenda ──── */
.cp-cal {
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border); position: relative;
}
.cp-cal-head {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}
.cp-cal-nav {
    width: 28px; height: 28px; border-radius: var(--radius-sm); border: none;
    background: var(--bg-hover); color: var(--text-secondary);
    font-size: 1.1rem; line-height: 1; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.cp-cal-nav:hover { background: var(--accent-soft); color: var(--accent-hover); }
.cp-cal-datebtn {
    flex: 1; padding: 5px 10px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-primary);
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: background var(--transition-fast);
}
.cp-cal-datebtn:hover { background: var(--bg-hover); }

/* Month picker popup — portalled to <body>, positioned fixed inline (see qa_calendar) */
.cp-pick {
    position: fixed; z-index: 4000;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
}
.cp-pick-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.cp-pick-title { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.cp-pick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cp-pick-wd { text-align: center; font-size: 0.625rem; color: var(--text-muted); padding: 2px 0; }
.cp-pick-cell {
    aspect-ratio: 1; border: none; background: transparent; cursor: pointer;
    color: var(--text-secondary); font-size: 0.75rem; border-radius: 6px;
    transition: all var(--transition-fast);
}
.cp-pick-cell.empty { background: none; cursor: default; }
.cp-pick-cell:not(.empty):hover { background: var(--bg-hover); color: var(--text-primary); }
.cp-pick-cell.sel { background: var(--accent); color: white; font-weight: 700; }

/* Scrollable 24h agenda */
.cp-cal-agenda {
    position: relative; height: 224px; overflow-y: auto; user-select: none;
    border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.18); scrollbar-width: thin;
}
.cp-cal-row {
    height: 28px; display: flex; align-items: flex-start; padding-left: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04); box-sizing: border-box;
}
.cp-cal-time {
    font-size: 0.625rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums; transform: translateY(-6px);
}
.cp-cal-event {
    position: absolute; left: 46px; right: 6px; min-height: 14px;
    border-radius: 6px; padding: 2px 8px; overflow: hidden; cursor: grab;
    display: flex; flex-direction: column; justify-content: flex-start;
}
.cp-cal-event:active { cursor: grabbing; }
.cp-cal-event-title {
    font-size: 0.72rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.cp-cal-event-time { font-size: 0.62rem; color: var(--text-muted); pointer-events: none; }
.cp-cal-event.provisional {
    background: rgba(99, 102, 241, 0.25); border: 1px dashed var(--accent); pointer-events: none;
}
.cp-cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cp-cal-resize:hover { background: rgba(255, 255, 255, 0.15); }

/* Add / edit form */
.cp-cal-add {
    width: 100%; margin-top: var(--space-sm); padding: 8px;
    background: var(--accent-soft); color: var(--accent-hover);
    border: 1px dashed rgba(99, 102, 241, 0.4); border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-cal-add:hover { background: rgba(99, 102, 241, 0.18); }
.cp-cal-form {
    margin-top: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-sm);
}
.cp-cal-input, .cp-cal-time-input {
    background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    padding: 7px 10px; font-size: 0.8125rem; font-family: var(--font-sans); outline: none;
}
.cp-cal-input:focus, .cp-cal-time-input:focus { border-color: var(--glass-border-hover); }
.cp-cal-form-row { display: flex; align-items: center; gap: var(--space-sm); }
.cp-cal-form-row .cp-cal-time-input { flex: 1; }
.cp-cal-dash { color: var(--text-muted); }
.cp-cal-form-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; }
.cp-cal-del, .cp-cal-cancel, .cp-cal-save {
    padding: 6px 9px; border-radius: var(--radius-sm); border: none;
    font-size: 0.73rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cp-cal-del { background: rgba(248, 113, 113, 0.15); color: var(--danger); margin-right: auto; }
.cp-cal-cancel { background: var(--bg-hover); color: var(--text-secondary); }
.cp-cal-save { background: var(--accent); color: white; }
.cp-cal-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* Create / edit popup (draggable, clamped on-screen) */
.cp-cal-popup {
    position: fixed; z-index: 4000; width: 280px;
    max-height: calc(100vh - 24px); overflow-y: auto;
    flex-direction: column; gap: var(--space-sm);
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: var(--space-sm) var(--space-md) var(--space-md);
}
.cp-cal-pop-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 calc(-1 * var(--space-md)) 0; padding: 4px var(--space-md) 8px;
    border-bottom: 1px solid var(--glass-border); cursor: grab; user-select: none;
}
.cp-cal-pop-head:active { cursor: grabbing; }
.cp-cal-pop-title { font-size: 0.8125rem; font-weight: 700; color: var(--text-primary); }
.cp-cal-pop-grip { color: var(--text-muted); font-size: 1rem; letter-spacing: -2px; }
.cp-cal-datefield {
    text-align: left; background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    color: var(--text-primary); padding: 7px 10px; font-size: 0.8125rem;
    font-family: var(--font-sans); cursor: pointer;
}
.cp-cal-datefield:hover { border-color: var(--glass-border-hover); }
.cp-cal-dp {
    background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: var(--space-sm);
}
.cp-cal-colors { display: flex; gap: var(--space-sm); }
.cp-cal-swatch {
    width: 26px; height: 26px; border-radius: 50%; border: none;
    cursor: pointer; transition: transform var(--transition-fast); padding: 0;
}
.cp-cal-swatch:hover { transform: scale(1.12); }
.cp-cal-swatch.on { box-shadow: 0 0 0 2px var(--glass-bg-solid), 0 0 0 4px rgba(255, 255, 255, 0.92); }
.cp-cal-notes {
    background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    padding: 7px 10px; font-size: 0.8125rem; font-family: var(--font-sans);
    outline: none; resize: vertical; min-height: 48px;
}
.cp-cal-notes:focus { border-color: var(--glass-border-hover); }
.cp-cal-pop-actions {
    display: flex; gap: 6px; align-items: center; flex-wrap: nowrap;
    justify-content: flex-end;
}
/* Above the popup (z 1000) so it actually captures the pointer while dragging */
.cp-cal-dragmask { position: fixed; inset: 0; z-index: 4001; cursor: grabbing; }
.cp-cal-event.preview { z-index: 5; }


/* Contact/Company profile — quick-action tasks: list · Aufgaben editor · task feed card */
/* ── Quick-action tasks (Aufgabe) ──────────────────────────────── */
.cp-task {
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
    display: flex; flex-direction: column; gap: var(--space-sm);
}
.cp-task-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.cp-task-empty { color: var(--text-muted); font-size: 0.8125rem; text-align: center; padding: 8px; }
.cp-task-row {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 6px 8px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.18);
}
.cp-task-check {
    width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
    border: 1.5px solid var(--glass-border); background: transparent;
    color: white; font-size: 0.7rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.cp-task-row.done .cp-task-check { background: var(--success); border-color: var(--success); }
.cp-task-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cp-task-title {
    font-size: 0.8125rem; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-task-row.done .cp-task-title { text-decoration: line-through; color: var(--text-muted); }
.cp-task-due { font-size: 0.6875rem; color: var(--text-muted); }
/* ══ Aufgaben editor — visual sibling of the E-Mail composer (.cp-mail-*) ══════
   Every selector is scoped under .cp-task-add (the centered column under
   .cp-task-tab), so the calendar/Termin editor — which reuses the same
   .cp-cal-input / .cp-cal-time-input / .cp-cal-notes / .cp-cal-datefield
   classes inside .cp-cal-form / .cp-cal-popup — is NEVER touched. ══════════ */

/* Base column: full-width compact (this is what the NARROW left quick-action
   uses — .cp-task-add with no modifier). */
.cp-task-add {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* WIDE right tab only: centered max-width column, sibling of .cp-mail-body.
   Gated on .cp-task-tab so it NEVER applies in the narrow left column. */
.cp-task-add.cp-task-tab {
    width: 56%;
    max-width: 540px;
    margin: 18px auto;
}

/* ROW 1 — two matched stepper pills (date · time). */
.cp-task-add .cp-task-add-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.cp-task-add .cp-task-pill {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.cp-task-add .cp-task-pill:focus-within {
    background: var(--bg-elevated);
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.cp-task-add .cp-task-chev {
    flex: 0 0 auto;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.cp-task-add .cp-task-chev:hover {
    color: var(--accent-hover);
    background: var(--accent-soft);
}
.cp-task-add .cp-task-chev svg { display: block; }

/* The themed date_field (.cp-cal-datefield) and the native time input become
   the flat, centered core of each pill — strip their own chrome. Scoped under
   .cp-task-add so the Termin editor's own controls keep their sunken skin. */
.cp-task-add .cp-task-pill .cp-cal-datefield,
.cp-task-add .cp-task-pill .cp-cal-time-input.cp-task-time {
    flex: 1;
    min-width: 0;
    width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    padding: 11px 2px;
    outline: none;
}
.cp-task-add .cp-task-pill .cp-cal-datefield:hover { border-color: transparent; }
.cp-task-add .cp-task-pill .cp-cal-time-input:focus { border-color: transparent; }
/* Hide the native time-input clock affordance so the pill reads clean. */
.cp-task-add .cp-task-time::-webkit-calendar-picker-indicator { display: none; }

/* ROW 2 — Aufgabenname: floating rounded field (mirrors .cp-mail-field). */
.cp-task-add .cp-cal-input.cp-task-name {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 11px 15px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.cp-task-add .cp-cal-input.cp-task-name::placeholder { color: var(--text-muted); }
.cp-task-add .cp-cal-input.cp-task-name:focus {
    background: var(--bg-elevated);
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ROW 3 — Notizen body block with actions docked inside (mirrors .cp-mail-editor). */
.cp-task-add .cp-task-editor {
    position: relative;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cp-task-add .cp-task-editor:focus-within {
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Notes textarea — transparent inside the block, shorter than the email body
   (per mockup), bottom padding clears the docked actions. */
.cp-task-add .cp-cal-notes.cp-task-notes {
    width: 100%;
    box-sizing: border-box;
    min-height: 96px;
    max-height: 200px;
    padding: 13px 15px 48px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.55;
    text-align: left;
}
.cp-task-add .cp-cal-notes.cp-task-notes::placeholder { color: var(--text-muted); }
.cp-task-add .cp-cal-notes.cp-task-notes:focus { border-color: transparent; }

/* Actions: Abbrechen (square) + primary Save, bottom-right INSIDE the block. */
.cp-task-add .cp-task-add-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}
/* Secondary square — Abbrechen (mirrors .cp-mail-sq). */
.cp-task-add .cp-task-sq {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
}
.cp-task-add .cp-task-sq:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
    border-color: var(--glass-border-hover);
}
.cp-task-add .cp-task-sq svg { display: block; }
/* Primary accent Save square (mirrors .cp-mail-send, radius-md per mockup). */
.cp-task-add .cp-task-save {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: all 0.18s ease;
}
.cp-task-add .cp-task-save:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}
.cp-task-add .cp-task-save:active { transform: translateY(0); }
.cp-task-add .cp-task-save:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
    transform: none;
}
.cp-task-add .cp-task-save svg { display: block; }

/* NARROW left quick-action tightening: shorter notes, no wasted height.
   Applies because .cp-task-tab is ABSENT. */
.cp-task-add:not(.cp-task-tab) .cp-cal-notes.cp-task-notes {
    min-height: 72px;
    padding-bottom: 46px;
}
.cp-task-add:not(.cp-task-tab) .cp-task-add-row { gap: 6px; }
.cp-task-addbtn {
    width: 38px; flex-shrink: 0; border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: white; font-size: 1.1rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition-fast);
}
.cp-task-addbtn:hover:not(:disabled) { background: var(--accent-hover); }
.cp-task-addbtn:disabled { opacity: 0.5; cursor: not-allowed; }

/* No divider + hug content (kill the big gap under save/cancel) in a tab pane. */
.cp-tab-pane > .cp-task { margin-top: var(--space-sm); padding-top: 0; border-top: none; }
.cp-note-editor.cp-tab-pane { min-height: 0; }

/* Edit-mode header in the task form */
.cp-task-edit-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px;
}
.cp-task-edit-title { font-size: 0.8125rem; font-weight: 700; color: var(--text-primary); }
.cp-task-edit-del {
    background: rgba(248, 113, 113, 0.15); color: var(--danger); border: none;
    border-radius: var(--radius-sm); padding: 4px 10px; font-size: 0.75rem; cursor: pointer;
}

/* ── Task card (in the chronological feed) ── */
.cp-task-card { border-left: 3px solid #a78bfa; }
.cp-task-card.done { opacity: 0.6; }
.cp-task-card-head { display: flex; align-items: center; gap: var(--space-sm); }
.cp-task-card.done .cp-task-check { background: var(--success); border-color: var(--success); }
.cp-task-card-main { flex: 1; min-width: 0; cursor: pointer; }
.cp-task-card-line { display: flex; align-items: center; gap: 8px; }
.cp-task-card-title {
    flex: 0 1 auto; min-width: 0; font-size: 0.875rem; font-weight: 700; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-task-card.done .cp-task-card-title { text-decoration: line-through; color: var(--text-muted); }
.cp-task-card-status {
    flex-shrink: 0; font-size: 0.6875rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
}
.cp-task-card-caret {
    margin-left: auto; flex-shrink: 0; color: var(--text-muted); font-size: 0.95rem;
    line-height: 1; transition: transform 0.15s;
}
.cp-task-card-caret.open { transform: rotate(180deg); }
.cp-task-card-due {
    display: flex; align-items: center; gap: 5px; margin-top: 3px;
    font-size: 0.75rem; color: var(--text-muted);
}
.cp-task-card-due-ic { display: inline-flex; }
.cp-task-card-due-ic svg { width: 13px; height: 13px; }
.cp-task-edit-btn {
    flex-shrink: 0; background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; display: flex; opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.cp-task-card:hover .cp-task-edit-btn { opacity: 1; }
.cp-task-edit-btn:hover { color: var(--text-primary); }
.cp-task-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; }
.cp-task-card-notes {
    margin: 8px 0 0; padding-left: 28px; font-size: 0.8125rem;
    color: var(--text-secondary); white-space: pre-wrap;
}


/* Contact/Company profile — generic left box · segmented tabs · note editor */
/* ── Box (generic left-column card) ─────────────────────────── */
.cp-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md);
}
.cp-box-title {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: var(--space-sm);
}
.cp-empty { color: var(--text-muted); font-size: 0.8125rem; }

/* Products */
.cp-products { display: flex; flex-direction: column; }
.cp-product-row {
    display: flex; justify-content: space-between; padding: var(--space-xs) 0;
    font-size: 0.8125rem; border-bottom: 1px solid rgba(100,116,139,0.06);
}
.cp-product-name { color: var(--text-primary); font-weight: 600; }
.cp-product-val { color: var(--text-accent); font-weight: 500; }
.cp-product-total {
    display: flex; justify-content: space-between; padding-top: var(--space-sm);
    font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
}

/* Contact Details */
.cp-detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; gap: 8px;
    font-size: 0.8125rem; border-bottom: 1px solid rgba(100,116,139,0.06);
}
.cp-detail-row:last-child { border-bottom: none; }
.cp-detail-label { color: var(--text-muted); flex-shrink: 0; min-width: 0; }
.cp-detail-value { color: var(--text-primary); text-align: right; word-break: break-all; max-width: 60%; }

/* Custom field inline input */
.cp-cf-input {
    width: 60%; max-width: 60%; text-align: right; padding: 3px 8px;
    font-size: 0.8125rem; color: var(--text-primary);
    background: transparent; border: 1px solid transparent;
    border-radius: 6px; outline: none;
    transition: all 0.15s;
}
.cp-cf-input:hover { border-color: rgba(255,255,255,0.08); }
.cp-cf-input:focus {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(0,0,0,0.15);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.cp-cf-input::placeholder { color: rgba(255,255,255,0.2); font-style: italic; }

/* Scoring */
.cp-score { display: flex; align-items: center; gap: var(--space-md); }
.cp-score-value { font-size: 1.25rem; font-weight: 700; color: var(--warning); }
.cp-score-bar {
    flex: 1; height: 6px; background: rgba(100, 116, 139, 0.15);
    border-radius: 3px; overflow: hidden;
}
.cp-score-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--warning), var(--success));
}

/* ── Tabs (segmented control — Mockup: Notizen · Anrufe · E-Mail · Aufgaben · Termin) ── */
.cp-tabs {
    display: flex; gap: 4px;
    background: rgba(0, 25, 47, 0.55);              /* #00192f container */
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 4px;
    overflow: visible;
}
.cp-tab {
    flex: 1; flex-basis: 0; min-width: 0;            /* equal-width segments */
    padding: 9px 6px; font-size: 0.8125rem; font-weight: 600;
    background: transparent; color: var(--text-secondary); border: none;
    border-radius: 10px; cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap; text-align: center;
    overflow: hidden; text-overflow: ellipsis;      /* 6 tabs: clip on narrow */
}
.cp-tab:hover { color: var(--text-primary); background: rgba(0, 40, 75, 0.45); }
.cp-tab.active {
    /* SVG: active = navy pill only, no accent line */
    background: #00284b; color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Termin/Aufgaben reuse the quick-action modules inside the shared card box.
   Per SVG the agenda/task form sit in a narrow centred column (~400px), not
   stretched across the whole right column. */
.cp-tab-pane { align-items: center; }
/* Termin agenda stays a narrow ~400px column; the Aufgaben editor spans the
   pane so its inner .cp-task-tab centres at 56%/540px like the E-Mail body. */
.cp-tab-pane > .cp-cal { width: 100%; max-width: 400px; }
.cp-tab-pane > .cp-task { width: 100%; }
/* No left-card divider when used as a tab pane. */
.cp-tab-pane > .cp-cal { margin-top: var(--space-sm); padding-top: 0; border-top: none; }

/* ── Note Editor ────────────────────────────────────────────── */
.cp-note-editor {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    min-height: 240px; display: flex; flex-direction: column;
}
.cp-note-toolbar {
    display: flex; justify-content: flex-end; align-items: center; gap: 4px;
    padding: 6px 8px 2px;
}
.cp-template-btn {
    display: flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm); font-size: 0.75rem;
    background: var(--bg-hover); color: var(--text-secondary); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
}
.cp-template-btn:hover { color: var(--text-primary); background: rgba(99,102,241,0.1); }
.cp-template-btn.open { color: var(--text-primary); background: rgba(99,102,241,0.15); }
.cp-template-btn svg { width: 14px; height: 14px; }
/* Icon-only editor tool buttons (attach / save template / pick template). */
.cp-icon-btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.cp-icon-btn svg { width: 15px; height: 15px; }
.cp-icon-btn.flash-ok { color: #22c55e; background: rgba(34, 197, 94, 0.12); }

/* Template picker popover — two columns: Favoriten (starred by THIS user)
   left, all tenant templates right. The panels anchor to the note input box
   (nearest positioned ancestor), edge to edge, instead of floating free. */
.cp-tpl-wrap { position: static; }
.cp-tpl-menu {
    position: absolute; top: 42px; left: 6px; right: 6px; z-index: 60;
    padding: 6px;
    background: var(--surface-raised, #1b2436);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
/* Portaled variant: fixed at the input box's measured edges, on the top
   layer — the editor container would clip an in-place absolute panel. */
.cp-tpl-menu.cp-tpl-menu-float {
    position: fixed; right: auto; z-index: 500;
}
.cp-tpl-cols { display: flex; align-items: stretch; }
.cp-tpl-col {
    flex: 1; min-width: 0; padding: 2px;
    display: flex; flex-direction: column;
}
/* Only the list scrolls; the column header stays pinned. Fixed cap so the
   popover keeps a stable size and scrolls once there are many templates. */
.cp-tpl-list {
    max-height: 224px; overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}
.cp-tpl-list::-webkit-scrollbar { width: 8px; }
.cp-tpl-list::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover); border-radius: 4px;
}
.cp-tpl-col + .cp-tpl-col {
    border-left: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    margin-left: 6px; padding-left: 8px;
}
.cp-tpl-head {
    flex: none;
    display: flex; align-items: center; gap: 4px;
    padding: 6px 8px 4px; font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted, #8b93a7);
}
.cp-tpl-head-star { display: inline-flex; color: #f59e0b; }
.cp-tpl-head-star svg { width: 11px; height: 11px; }
/* Row = insert button + star toggle side by side (buttons must not nest). */
.cp-tpl-row { display: flex; align-items: center; gap: 2px; }
.cp-tpl-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px; border: none; background: none; text-align: left;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background var(--transition-fast);
}
.cp-tpl-item:hover { background: var(--bg-hover); }
.cp-tpl-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.cp-tpl-preview {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.75rem; color: var(--text-muted, #8b93a7);
}
/* Star: hidden until the row is hovered; always visible once faved. */
.cp-tpl-star {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    border: none; background: none; border-radius: var(--radius-sm);
    color: var(--text-muted, #8b93a7); cursor: pointer;
    opacity: 0; transition: opacity var(--transition-fast), color var(--transition-fast);
}
.cp-tpl-row:hover .cp-tpl-star, .cp-tpl-star.faved { opacity: 1; }
.cp-tpl-star:hover { color: #f59e0b; background: var(--bg-hover); }
.cp-tpl-star.faved { color: #f59e0b; }
.cp-tpl-star svg { width: 15px; height: 15px; }
.cp-tpl-empty {
    padding: 10px 8px; font-size: 0.78rem; line-height: 1.4;
    color: var(--text-muted, #8b93a7);
}

/* "Als Vorlage speichern" popover — small naming panel at the same anchor. */
.cp-tpl-save {
    position: absolute; top: 42px; right: 6px; z-index: 60;
    width: min(320px, 86vw);
    padding: 10px;
    background: var(--surface-raised, #1b2436);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    display: flex; flex-direction: column; gap: 8px;
}
.cp-tpl-save-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.cp-tpl-save-input {
    width: 100%; padding: 7px 9px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.85rem;
}
.cp-tpl-save-input:focus { outline: none; border-color: var(--accent); }
.cp-tpl-save-error { font-size: 0.75rem; color: #ef4444; }
.cp-tpl-save-actions { display: flex; justify-content: flex-end; gap: 6px; }
.cp-tpl-save-btn {
    padding: 6px 12px; font-size: 0.8rem; font-weight: 600;
    background: var(--accent); color: white; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background var(--transition-fast);
}
.cp-tpl-save-btn:hover { background: var(--accent-hover); }
.cp-tpl-save-btn:disabled { opacity: 0.5; cursor: default; }
.cp-tpl-save-cancel {
    padding: 6px 10px; font-size: 0.8rem;
    background: none; color: var(--text-secondary); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
}
.cp-tpl-save-cancel:hover { background: var(--bg-hover); color: var(--text-primary); }
/* ── Attachment drag&drop over the feed area ─────────────────── */
/* The overlay anchors to the scroll container; the label stays in view via
   sticky while the (possibly long) feed keeps its scroll height. */
.cp-right-body { position: relative; }
.cp-dropzone-overlay {
    position: absolute; inset: 0; z-index: 50; pointer-events: none;
    display: flex; justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
}
.cp-dropzone-label {
    position: sticky; top: 40%; height: fit-content;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px;
    background: var(--surface-raised, #1b2436);
    border: 1px solid var(--accent);
    color: var(--text-primary); font-size: 0.9rem; font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.cp-dropzone-label svg { width: 18px; height: 18px; color: var(--accent); }
.cp-upload-status {
    margin: 4px 2px 8px; padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-secondary); font-size: 0.8rem;
}
.cp-upload-status.err { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

/* Inner centered note input box (positioned: the template popovers anchor
   to its edges instead of floating over the surrounding editor card). */
.cp-note-input-box {
    width: 55%; margin: 12px auto;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    flex: 1; display: flex; flex-direction: column;
    position: relative;
}
/* Drag & drop a file onto the note field. */
.cp-note-input-box.dragover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.cp-note-drop-hint {
    position: absolute; inset: 0; z-index: 40;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(99, 102, 241, 0.14);
    border-radius: var(--radius-sm);
    color: var(--text-accent, #a5b4fc); font-size: 0.85rem; font-weight: 600;
    pointer-events: none;
}
.cp-note-drop-hint svg { width: 16px; height: 16px; }
/* Call panel: full width, no inner box nesting */
.cp-note-input-box.cp-call-panel {
    width: 100%; margin: 0;
    background: transparent; border: none;
    padding: 16px 20px;
}
.cp-note-footer {
    display: flex; justify-content: flex-end;
    align-items: center; gap: 10px;
    padding: 0 var(--space-md) var(--space-sm);
}
.cp-send-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); border: none; color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition-fast);
}
.cp-send-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.cp-send-btn svg { width: 16px; height: 16px; }


/* ── Attachment card: column layout + inline preview accordion ── */
/* Double-class beats .cp-doc-card's align-items:center regardless of
   bundle order (that rule lives in _contact_profile_area.css). */
.cp-doc-card.cp-att-card { flex-direction: column; align-items: stretch; }
.cp-att-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cp-att-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
    padding: 0; background: none; border: none; text-align: left; cursor: pointer;
}
.cp-att-info:hover .cp-doc-card-name { color: var(--accent); }
.cp-att-chev {
    display: flex; align-items: center; color: var(--text-muted, #8b93a7);
    transition: transform var(--transition-fast);
}
.cp-att-chev.open { transform: rotate(180deg); }
.cp-att-preview {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}
.cp-att-img {
    display: block; max-width: 100%; max-height: 480px;
    margin: 0 auto; border-radius: 8px;
}
.cp-att-pdf {
    width: 100%; height: 560px; border: none;
    border-radius: 8px; background: white;
}
.cp-att-text {
    max-height: 380px; overflow: auto; margin: 0; padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25); border-radius: 8px;
    font-size: 0.78rem; line-height: 1.5; color: var(--text-primary);
    white-space: pre-wrap; word-break: break-word;
}
.cp-att-note { padding: 8px 4px; font-size: 0.8rem; color: var(--text-muted, #8b93a7); }

/* ============================================================
   Inline rich-text note editor (rne-) — the note field itself
   is the editor (contact + company profile). Formatting buttons
   live in the note toolbar row: bold/italic/underline/strike ·
   heading · lists · clear. Also: safe rendering of rich note
   content in feed cards (.cp-note-rich).
   ============================================================ */

/* Pushes the formatting group to the right edge of the note toolbar. */
.cp-toolbar-spacer { flex: 1; }

/* ── Formatting buttons (in .cp-note-toolbar) ────────────── */
.rne-btn {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.rne-btn svg { width: 14px; height: 14px; }
.rne-btn:hover { background: rgba(148, 163, 184, 0.1); color: var(--text-primary); }
.rne-btn.active {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent-hover);
}
.rne-sep {
    width: 1px; height: 16px; margin: 0 3px;
    background: var(--glass-border); flex: none;
}

/* ── Editable area (replaces the old textarea) ───────────── */
.rne-inline-wrap {
    position: relative; flex: 1;
    display: flex; min-height: 150px;
}
.rne-inline {
    flex: 1; overflow-y: auto; max-height: 42vh;
    padding: var(--space-md);
    font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.6;
    color: var(--text-primary);
    outline: none; cursor: text;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}
.rne-inline p { margin: 0 0 6px; }
.rne-inline h3 {
    margin: 10px 0 6px;
    font-size: 1.05rem; font-weight: 600; color: var(--text-primary);
}
.rne-inline h3:first-child { margin-top: 0; }
.rne-inline ul, .rne-inline ol { margin: 0 0 6px; padding-left: 22px; }
.rne-inline li { margin: 2px 0; }

.rne-placeholder {
    position: absolute; top: var(--space-md); left: var(--space-md);
    font-size: 0.875rem; color: var(--text-muted);
    pointer-events: none;
}

/* ── Staged files (dropped/picked, uploaded on send) ──────────
   One line pinned at the field's bottom edge (inside the footer row,
   left of the send button): no wrapping — overflowing chips scroll
   horizontally. Even spacing comes from the footer's paddings. */
.rne-staged {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 6px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}
.rne-staged::-webkit-scrollbar { height: 6px; }
.rne-staged::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover); border-radius: 3px;
}
.rne-chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 240px; padding: 4px 6px 4px 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.75rem; color: var(--text-primary);
}
.rne-chip-icon { display: flex; color: var(--text-accent); }
.rne-chip-icon svg { width: 11px; height: 11px; }
.rne-chip-name {
    min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.rne-chip-x {
    display: flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; padding: 0; flex: none;
    background: transparent; border: none; border-radius: 50%;
    color: var(--text-muted); cursor: pointer;
}
.rne-chip-x:hover { color: var(--text-primary); background: rgba(148, 163, 184, 0.2); }
.rne-chip-x svg { width: 10px; height: 10px; }
.rne-stage-err {
    padding: 4px var(--space-md) 0;
    font-size: 0.75rem; color: #ef4444;
}

/* ── Files inside a note card (note_id attachments) ────────
   The SAME expandable attachment rows as standalone uploads, stacked
   chronologically inside the note's box. */
.cp-note-atts {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 10px;
}
.cp-note-atts .cp-doc-card.cp-att-card {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
}

/* ── Rich note content in feed cards ─────────────────────── */
.cp-note-content.cp-note-rich { white-space: normal; }
.cp-note-rich p { margin: 0 0 6px; }
.cp-note-rich p:last-child { margin-bottom: 0; }
.cp-note-rich h3 {
    margin: 8px 0 4px;
    font-size: 13.5px; font-weight: 600; color: var(--text-primary);
}
.cp-note-rich h3:first-child { margin-top: 0; }
.cp-note-rich ul, .cp-note-rich ol { margin: 0 0 6px; padding-left: 20px; }
.cp-note-rich li { margin: 1px 0; }
/* Collapsed state: clamp + fade instead of slicing HTML by chars. */
.cp-note-rich.clamped {
    max-height: 116px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 72px, transparent);
    mask-image: linear-gradient(to bottom, #000 72px, transparent);
}

/* ============================================================
   Radial "•••" quick-action menu + "Dateien" file browser view.
   The satellites are portaled to <body> (the left column scrolls
   and would clip them) and fly out in a quarter circle up-right
   of the dots button, which morphs into an X while open.
   ============================================================ */

/* ── Toggle: ••• ↔ X morph ───────────────────────────────── */
.cp-radial-wrap { display: flex; }
.cp-radial-toggle-icon {
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.cp-radial-toggle.open { background: var(--accent); color: white; }
.cp-radial-toggle.open .cp-radial-toggle-icon { transform: rotate(90deg); }

/* ── Satellites: same 44px circles, staggered fly-out ────── */
.cp-radial-sats { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.cp-radial-sat {
    position: fixed; z-index: 401; pointer-events: auto;
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border-hover);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    animation: cpRadialOut 0.28s cubic-bezier(0.3, 1.4, 0.5, 1) backwards;
}
.cp-radial-sat:hover { background: var(--accent); color: white; }
.cp-radial-sat.danger:hover { background: #ef4444; }
@keyframes cpRadialOut {
    from { transform: translate(var(--dx), var(--dy)) scale(0.4); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* ── Dismissable "Dateien" tab (only while the view is active) ── */
.cp-tab-files { display: inline-flex; align-items: center; gap: 6px; }
.cp-tab-files-icon { display: flex; }
.cp-tab-files-icon svg { width: 12px; height: 12px; }
.cp-tab-files-x { display: flex; opacity: 0.7; }
.cp-tab-files-x svg { width: 11px; height: 11px; }
.cp-tab-files:hover .cp-tab-files-x { opacity: 1; }

/* ── Dateien view (right feed panel) ─────────────────────── */
.cp-files-intro {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 2px 6px;
}
.cp-files-intro-icon {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent-hover);
}
.cp-files-intro-icon svg { width: 15px; height: 15px; }
.cp-files-intro-title {
    font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.cp-files-section { margin-top: 10px; }
.cp-files-head {
    display: flex; align-items: center; gap: 7px;
    padding: 0 2px 8px;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted);
}
.cp-files-head-icon { display: flex; color: var(--text-secondary); }
.cp-files-head-icon svg { width: 13px; height: 13px; }
.cp-files-count {
    padding: 1px 8px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--text-accent);
    font-size: 0.7rem; font-weight: 600;
}
.cp-files-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Image grid + lightbox ───────────────────────────────── */
.cp-files-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.cp-files-tile {
    position: relative; aspect-ratio: 1;
    border-radius: var(--radius-sm); overflow: hidden;
    background: rgba(6, 10, 20, 0.45);
    border: 1px solid var(--glass-border);
    cursor: zoom-in;
}
.cp-files-tile img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.cp-files-tile-loading {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); opacity: 0.6;
}
.cp-files-tile-name {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 10px 8px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    font-size: 0.7rem; color: #e2e8f0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-files-tile-note {
    position: absolute; top: 6px; right: 6px;
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    background: rgba(12, 18, 34, 0.8);
    border: 1px solid var(--glass-border); border-radius: 50%;
    color: var(--text-accent); cursor: pointer;
}
.cp-files-tile-note svg { width: 11px; height: 11px; }
.cp-files-tile-note:hover { background: var(--accent); color: white; }
.cp-lightbox {
    position: fixed; inset: 0; z-index: 600;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: rgba(4, 8, 18, 0.88);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
    animation: rneFade 0.15s ease-out;
}
.cp-lightbox img {
    max-width: 90vw; max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.cp-lightbox-name { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Origin line ("aus Notiz — öffnen") + jump flash ─────── */
.cp-files-item { display: flex; flex-direction: column; gap: 3px; }
.cp-files-origin { padding-left: 4px; }
.cp-files-origin button {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 4px; background: none; border: none;
    font-size: 0.72rem; color: var(--text-accent); cursor: pointer;
}
.cp-files-origin button:hover { text-decoration: underline; }
.cp-files-origin svg { width: 11px; height: 11px; }
.note-flash { animation: cpNoteFlash 1.6s ease-out; }
@keyframes cpNoteFlash {
    0% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px var(--accent-glow); }
    100% { box-shadow: none; }
}

/* ── Email attachment rows (no delete — the file belongs to the mail) ── */
.cp-mailatt-card .cp-att-info { cursor: default; }

/* ── Finder WINDOW: one framed glass panel ───────────────────
   titlebar (‹ › · title · view segments · search · new folder)
   → body (sidebar | scrollable content) → bottom path bar.   */
.cp-files-browser.cp-fx {
    display: flex; flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    /* No drop shadow — the profile's cards/composer sit FLAT on the bg; a
       shadow-md here darkened the bottom edge + the inner glow lit the top,
       so the box's top/bottom read off-palette against the flush cards. */
    overflow: hidden;
}

/* ── Titlebar ────────────────────────────────────────────── */
.cp-fx-titlebar {
    flex: none;
    display: flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 12px;
    /* Transparent — inherits the window's --glass-bg so the strip reads as
       part of the box (a slate overlay made it lighter than the rest). The
       hairline border is the only divider. */
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
}
.cp-fx-navgroup { display: flex; gap: 2px; }
.cp-fx-nav {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    background: transparent; border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    transition: all 0.12s;
}
.cp-fx-nav:hover:not(:disabled) { color: var(--text-primary); background: rgba(148, 163, 184, 0.1); }
.cp-fx-nav:disabled { opacity: 0.28; cursor: default; }
.cp-fx-nav svg { width: 15px; height: 15px; }
.cp-fx-title {
    flex: 1; min-width: 0;
    font-size: 0.92rem; font-weight: 650; color: var(--text-primary);
    letter-spacing: 0.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-fx-viewtoggle {
    display: flex; gap: 2px; padding: 2px;
    background: rgba(6, 10, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.cp-fx-viewtoggle button {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 24px; padding: 0;
    background: transparent; border: none; border-radius: 6px;
    color: var(--text-muted); cursor: pointer;
    transition: all 0.12s;
}
.cp-fx-viewtoggle button:hover { color: var(--text-secondary); }
.cp-fx-viewtoggle button.active {
    background: var(--accent-soft); color: var(--text-accent);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}
.cp-fx-viewtoggle button svg { width: 14px; height: 14px; }
.cp-fx-search { position: relative; flex: 0 1 190px; min-width: 110px; }
.cp-fx-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    display: flex; color: var(--text-muted); pointer-events: none;
}
.cp-fx-search-icon svg { width: 12px; height: 12px; }
.cp-fx-search .cp-files-search {
    width: 100%; height: 30px;
    padding: 0 12px 0 28px;
    background: rgba(6, 10, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary); font-size: 0.78rem;
}
.cp-fx-search .cp-files-search:focus { outline: none; border-color: var(--accent); }
.cp-fx-search .cp-files-search::placeholder { color: var(--text-muted); }
.cp-fx-fs {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 30px; padding: 0; flex: none;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    transition: all 0.12s;
}
.cp-fx-fs:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.cp-fx-fs.active {
    background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-accent);
}
.cp-fx-fs svg { width: 14px; height: 14px; }

/* Fullscreen: the parent hides the composer box; the freed height flows to
   the window (its body height is MEASURED in chrome.rs — window top → column
   bottom — so the path bar always ends flush with the viewport edge). */
.cp-right-editor.fs-hidden { display: none; }

/* Files view fill-height (pure flexbox, no JS measuring):
   give the column a DEFINITE height so the window fills it top-to-bottom.
   `.cp-fx` only exists while the files view is open, so `:has()` scopes all
   of this to that mode. Titlebar + path bar stay pinned; the outer body never
   scrolls (only `.cp-fx-main` inside does); fullscreen (composer hidden) grows
   the window automatically. This replaces the old measure-and-set approach —
   `.cp-right-body` sizes to its content, so measuring against it was circular
   and over-sized the window at short viewports (titlebar scrolled away). */
.cp-right:has(.cp-files-browser.cp-fx) { height: calc(100vh - 120px); }
.cp-right-body:has(.cp-files-browser.cp-fx) { overflow: hidden; }
.cp-right-body:has(.cp-files-browser.cp-fx) > .cp-feed-list {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.cp-files-browser.cp-fx { min-height: 0; }
.cp-right-body .cp-files-browser.cp-fx { height: 100%; }

/* ── Body: sidebar | content — flex:1 fills the window between the titlebar
   and the path bar (the window fills the definite-height column above). Both
   panes scroll independently (contained). ── */
.cp-fx-body {
    flex: 1; min-height: 0;
    display: flex; align-items: stretch;
}
.cp-fx-sidebar {
    flex: 0 0 186px; overflow-y: auto;
    overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 8px;
    background: rgba(8, 12, 24, 0.5);
    border-right: 1px solid var(--glass-border);
}
.cp-fx-side-head {
    padding: 10px 8px 4px;
    font-size: 0.64rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-muted);
}
.cp-fx-side-head:first-child { padding-top: 2px; }
.cp-fx-side-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 6px 10px;
    background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 0.8rem;
    cursor: pointer; transition: all 0.12s; text-align: left;
}
.cp-fx-side-item:hover { color: var(--text-primary); background: rgba(148, 163, 184, 0.08); }
.cp-fx-side-item.active {
    background: rgba(99, 102, 241, 0.18); color: var(--text-primary);
}
.cp-fx-side-item.drop {
    border-color: var(--accent); background: var(--accent-soft);
}
.cp-fx-side-icon { display: flex; flex: none; color: var(--text-accent); }
.cp-fx-side-icon svg { width: 14px; height: 14px; }
/* macOS-style colored sidebar glyphs, mapped to the app palette */
.cp-fx-side-icon.t-indigo { color: var(--accent-hover); }
.cp-fx-side-icon.t-sky { color: #38bdf8; }
.cp-fx-side-icon.t-blue { color: var(--info); }
.cp-fx-side-icon.t-amber { color: var(--warning); }
.cp-fx-side-icon.t-green { color: var(--success); }
.cp-fx-side-label {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-fx-side-count {
    margin-left: auto; padding: 0 7px;
    border-radius: var(--radius-full);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted); font-size: 0.68rem; font-weight: 600;
}
.cp-fx-main { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.cp-fx-pad { padding: 12px 14px 16px; }
.cp-fx-main > .cp-files-err { margin: 10px 14px 0; }

/* ── List view: sticky header, zebra rows, tinted icon chips ── */
.cp-fx-list-head, .cp-fx-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 130px 84px 118px 92px;
    align-items: center; gap: 8px;
    padding: 0 12px;
}
.cp-fx-list-head {
    position: sticky; top: 0; z-index: 3;
    height: 34px;
    background: var(--glass-bg-solid);
    border-bottom: 1px solid var(--glass-border);
}
.cp-fx-col {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0; background: none; border: none;
    font-size: 0.67rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); cursor: pointer; text-align: left;
}
.cp-fx-col:hover { color: var(--text-primary); }
.cp-fx-sortdir { font-size: 0.6rem; color: var(--text-accent); }
.cp-fx-row {
    height: 42px;
    cursor: default; transition: background 0.1s;
}
.cp-fx-row:nth-child(odd) { background: rgba(148, 163, 184, 0.035); }
.cp-fx-row:hover { background: rgba(99, 102, 241, 0.09); }
.cp-fx-row.folder { cursor: pointer; }
.cp-fx-row.drop {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.cp-fx-cell { min-width: 0; font-size: 0.82rem; color: var(--text-primary); }
.cp-fx-cell.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-fx-cell.dim { color: var(--text-muted); font-size: 0.74rem; }
.cp-fx-cell.icon { display: flex; align-items: center; justify-content: center; }
.cp-fx-chip {
    display: flex; align-items: center; justify-content: center;
    width: 27px; height: 27px; border-radius: 7px;
    background: rgba(148, 163, 184, 0.1); color: var(--text-secondary);
}
.cp-fx-chip svg { width: 14px; height: 14px; }
.cp-fx-chip.k-folder { background: rgba(99, 102, 241, 0.16); color: var(--accent-hover); }
.cp-fx-chip.k-pdf { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.cp-fx-chip.k-img { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.cp-fx-chip.k-sheet { background: rgba(52, 211, 153, 0.13); color: var(--success); }
.cp-fx-chip.k-doc { background: rgba(96, 165, 250, 0.14); color: var(--info); }
.cp-fx-chip.k-zip { background: rgba(251, 191, 36, 0.13); color: var(--warning); }
.cp-fx-chip.k-slides { background: rgba(251, 146, 60, 0.14); color: #fb923c; }
.cp-fx-mini {
    width: 27px; height: 27px; object-fit: cover;
    border-radius: 7px; display: block;
    border: 1px solid var(--glass-border);
}
.cp-fx-cell.actions {
    display: flex; justify-content: flex-end; gap: 4px;
    opacity: 0; transition: opacity 0.12s;
}
.cp-fx-row:hover .cp-fx-cell.actions { opacity: 1; }
.cp-fx-cell.actions button {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
}
.cp-fx-cell.actions button:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    background: rgba(148, 163, 184, 0.08);
}
.cp-fx-cell.actions button svg { width: 13px; height: 13px; }
.cp-fx-row.file[draggable="true"] { cursor: grab; }
.cp-fx-row.file[draggable="true"]:active { cursor: grabbing; }

/* ── Bottom path bar: segments are drop targets + stats ──── */
.cp-fx-pathbar {
    flex: none;
    display: flex; align-items: center; gap: 2px;
    height: 32px; padding: 0 12px;
    /* Transparent to match the box (see titlebar); hairline divider only. */
    background: transparent;
    border-top: 1px solid var(--glass-border);
}
.cp-fx-path-icon { display: flex; margin-right: 4px; color: var(--text-muted); }
.cp-fx-path-icon svg { width: 12px; height: 12px; }
.cp-fx-path-seg {
    padding: 3px 7px;
    background: transparent; border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted); font-size: 0.72rem;
    cursor: pointer; transition: all 0.12s;
    white-space: nowrap;
}
.cp-fx-path-seg:hover { color: var(--text-primary); background: rgba(148, 163, 184, 0.08); }
.cp-fx-path-seg.active { color: var(--text-secondary); font-weight: 600; cursor: default; }
.cp-fx-path-seg.drop {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--text-accent);
}
.cp-fx-path-sep { color: var(--text-muted); opacity: 0.55; font-size: 0.72rem; }
.cp-fx-stats { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; }

/* ── Name dialog (create/rename — replaces native prompt) ── */
.cp-dlg-overlay {
    position: fixed; inset: 0; z-index: 660;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 18vh;
    background: rgba(4, 8, 18, 0.55);
    animation: rneFade 0.12s ease-out;
}
.cp-dlg {
    width: min(360px, calc(100vw - 40px));
    padding: 16px;
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: cpCtxIn 0.14s var(--ease-standard);
}
.cp-dlg-title {
    margin-bottom: 10px;
    font-size: 0.88rem; font-weight: 650; color: var(--text-primary);
}
.cp-dlg-input {
    width: 100%; padding: 9px 11px;
    background: rgba(6, 10, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.85rem;
}
.cp-dlg-input:focus { outline: none; border-color: var(--accent); }
.cp-dlg-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    margin-top: 12px;
}
.cp-dlg-cancel {
    padding: 7px 13px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 0.78rem;
    cursor: pointer; transition: all 0.12s;
}
.cp-dlg-cancel:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.cp-dlg-ok {
    padding: 7px 16px;
    background: var(--accent); border: none;
    border-radius: var(--radius-sm);
    color: white; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all 0.12s;
}
.cp-dlg-ok:hover { background: var(--accent-hover); }

/* ── Right-click context menu (portaled, viewport-clamped) ── */
.cp-ctx-overlay { position: fixed; inset: 0; z-index: 640; }
.cp-ctx-menu {
    position: fixed; z-index: 641;
    min-width: 210px; max-width: 260px;
    max-height: 60vh; overflow-y: auto;
    padding: 6px;
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: cpCtxIn 0.12s var(--ease-standard);
}
@keyframes cpCtxIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.cp-ctx-item {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 7px 10px;
    background: transparent; border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.8rem;
    cursor: pointer; text-align: left; transition: background 0.1s;
}
.cp-ctx-item:hover:not(:disabled) { background: var(--accent-soft); }
.cp-ctx-item:disabled { cursor: default; color: var(--text-muted); }
.cp-ctx-item.danger { color: var(--danger); }
.cp-ctx-item.danger:hover { background: rgba(248, 113, 113, 0.12); }
.cp-ctx-item-icon { display: flex; flex: none; color: var(--text-secondary); }
.cp-ctx-item.danger .cp-ctx-item-icon { color: var(--danger); }
.cp-ctx-item-icon svg { width: 14px; height: 14px; }
.cp-ctx-item.move { font-size: 0.78rem; padding-top: 5px; padding-bottom: 5px; }
.cp-ctx-item.move .cp-ctx-item-icon { color: var(--text-accent); }
.cp-ctx-item.move .cp-ctx-item-icon svg { width: 12px; height: 12px; }
.cp-ctx-check { margin-left: auto; color: var(--text-accent); font-size: 0.75rem; }
.cp-ctx-sep { height: 1px; margin: 5px 4px; background: var(--glass-border); }
.cp-ctx-head {
    padding: 5px 10px 3px;
    font-size: 0.64rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* ── Empty state ─────────────────────────────────────────── */
.cp-fx-empty {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 48px 20px;
}
.cp-fx-empty-icon {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; margin-bottom: 4px;
    border-radius: var(--radius-md);
    background: rgba(148, 163, 184, 0.07);
    color: var(--text-muted);
}
.cp-fx-empty-icon svg { width: 21px; height: 21px; }
.cp-fx-empty p {
    margin: 0;
    font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
}
.cp-fx-empty-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ── Explorer: folder tiles ──────────────────────────────── */
.cp-folder-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin-bottom: 14px;
}
.cp-folder-tile {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 12px 12px 10px;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.12s;
}
.cp-folder-tile:hover {
    border-color: var(--glass-border-hover);
    background: rgba(99, 102, 241, 0.07);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.cp-folder-tile.drop {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.cp-folder-tile.dragging { opacity: 0.45; }
.cp-folder-tile-icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-bottom: 2px;
    border-radius: 9px;
    background: rgba(99, 102, 241, 0.14); color: var(--accent-hover);
}
.cp-folder-tile-icon svg { width: 18px; height: 18px; }
.cp-folder-tile-name {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.84rem; font-weight: 600; color: var(--text-primary);
}
.cp-folder-tile-meta { font-size: 0.7rem; color: var(--text-muted); }
.cp-folder-tile-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 4px; opacity: 0;
    transition: opacity 0.12s;
}
.cp-folder-tile:hover .cp-folder-tile-actions { opacity: 1; }
.cp-folder-tile-actions button {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    background: rgba(12, 18, 34, 0.8);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
}
.cp-folder-tile-actions button:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.cp-folder-tile-actions button svg { width: 12px; height: 12px; }
.cp-folder-tile.virtual {
    background: rgba(6, 10, 20, 0.4);
    border-style: dashed;
}
.cp-folder-tile.virtual .cp-folder-tile-icon { color: var(--text-secondary); }

/* ── Explorer: new-folder button (titlebar icon) + popover ── */
.cp-folder-new-wrap { position: relative; display: flex; }
.cp-files-newfolder {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 30px; padding: 0;
    background: var(--accent-soft);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-sm);
    color: var(--text-accent);
    cursor: pointer; transition: all 0.12s;
}
.cp-files-newfolder:hover { background: var(--accent); color: white; }
.cp-files-newfolder svg { width: 16px; height: 16px; }
.cp-folder-pop {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
    display: flex; gap: 6px;
    padding: 8px;
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border-hover);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}
.cp-folder-pop input {
    width: 180px; padding: 7px 9px;
    background: rgba(6, 10, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.82rem;
}
.cp-folder-pop input:focus { outline: none; border-color: var(--accent); }
.cp-folder-pop-ok {
    padding: 7px 12px;
    background: var(--accent); border: none; border-radius: var(--radius-sm);
    color: white; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}

/* ── Explorer: drag source, error banner, search badge ───── */
.cp-files-item.draggable { cursor: grab; }
.cp-files-item.draggable:active { cursor: grabbing; }
.cp-files-err {
    margin: 0 0 10px; padding: 8px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    color: #fca5a5; font-size: 0.78rem;
}
.cp-files-pathhint {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 4px;
    font-size: 0.72rem; color: var(--text-muted);
}
.cp-files-pathhint svg { width: 11px; height: 11px; }

/* ── Dokumenten-Menü — widget popover + admin "Dateien" catalog ── */

/* Widget popover (rides .cp-ctx-menu for the frame) */
.gp-menu { min-width: 240px; max-width: 300px; }
.gp-kind {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
}

/* File-kind chips — same palette as the explorer's .cp-fx-chip kinds */
.gp-kind.k-pdf, .adf-chip.k-pdf { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.gp-kind.k-doc, .adf-chip.k-doc { background: rgba(96, 165, 250, 0.14); color: var(--info); }
.gp-kind.k-slides, .adf-chip.k-slides { background: rgba(251, 146, 60, 0.14); color: #fb923c; }

/* Admin · Dateien */
.adf-chip {
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em;
    vertical-align: 1px;
}
.adf-select { max-width: 260px; }
.adf-phs {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: flex-end; max-width: 60%;
}
.adf-ph {
    padding: 2px 8px;
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--text-accent);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
}

/* ── Deal-Badge — kleiner Kreis an der Avatar-Kante (unten rechts):
   grün mit $ bei aktivem Deal, rot mit ✕ bei Lost. Gilt im Profil-Header
   (88px-Avatar, große Variante) und in den Kontaktlisten (40px-Avatare). ── */

.cp-avatar,
.contact-card-avatar,
.company-avatar,
.contact-avatar { position: relative; }

.deal-badge {
    position: absolute;
    right: -3px; bottom: -3px;
    display: flex; align-items: center; justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    color: #fff;
    font-size: 0.55rem; font-weight: 800; line-height: 1;
    pointer-events: none;
}
.deal-badge.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}
.deal-badge.lost {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.5);
}
.deal-badge.deal-badge-lg {
    width: 26px; height: 26px;
    right: 0; bottom: 0;
    border-width: 3px;
    font-size: 0.85rem;
}

/* ── Untere Aktionszeile im Profil (Konvertierung + rote Aktionen) ── */
.cp-bottom-actions {
    display: flex; flex-direction: column; gap: 10px;
    align-items: stretch;
    margin-top: var(--space-lg);
    padding: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.cp-bottom-actions .cp-bottom-btn { width: 100%; }
.cp-bottom-btn {
    padding: 8px var(--space-lg);
    border: none; border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
}
.cp-bottom-btn:disabled { opacity: 0.6; cursor: default; }
.cp-bottom-btn.convert {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.35);
}
.cp-bottom-btn.convert:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.5); }
.cp-bottom-btn.danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
}
.cp-bottom-btn.danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.3); }
.cp-bottom-btn.danger.is-armed {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 14px rgba(248, 113, 113, 0.6);
}
.cp-bottom-err { width: 100%; color: var(--danger); font-size: 0.78rem; }


/* ── Activity Card (inline in chrono feed) ─────────────────── */
.cp-activity-card {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--activity-color, #6366f1) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--activity-color, #6366f1) 15%, transparent);
    border-radius: 12px;
    border-left: 3px solid var(--activity-color, #6366f1);
    transition: all 0.2s ease;
}
.cp-activity-card:hover {
    background: color-mix(in srgb, var(--activity-color, #6366f1) 10%, transparent);
    border-color: color-mix(in srgb, var(--activity-color, #6366f1) 25%, transparent);
}
.cp-activity-icon {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex-shrink: 0;
    background: color-mix(in srgb, var(--activity-color, #6366f1) 15%, transparent);
    border-radius: 8px;
    color: var(--activity-color, #6366f1);
    margin-top: 1px;
}
.cp-activity-icon svg { width: 14px; height: 14px; }
.cp-activity-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.cp-activity-text {
    font-size: 0.82rem; font-weight: 500; color: var(--text-primary);
    line-height: 1.4;
}
.cp-activity-meta {
    font-size: 0.72rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Timeline Pill ──────────────────────────────────────────── */
.cp-timeline-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--accent-hover);
    font-size: 0.75rem; font-weight: 600;
    border: 1px solid rgba(99,102,241,0.25);
    cursor: pointer; transition: all var(--transition-fast);
}
.cp-timeline-pill:hover { background: rgba(99,102,241,0.2); }
.cp-pill-arrow {
    display: inline-block; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid currentColor; transition: transform var(--transition-fast);
}
.cp-pill-arrow.open { transform: rotate(180deg); }

/* Expanded state: outline only, no fill */
.cp-timeline-pill.open {
    background: transparent;
    border-color: rgba(99,102,241,0.35);
}
.cp-timeline-pill.open:hover { background: rgba(99,102,241,0.08); }

/* ── Pill Wrapper (chronologically positioned) ─────────────── */
.cp-activity-pill-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100%;
    background: transparent;
    border: none;
}
.cp-activity-pill-wrapper .cp-timeline-pill {
    border-radius: var(--radius-full);
}

/* ── Enhanced Timeline (inside pill dropdown) ──────────────── */
.cp-tl-list {
    position: relative;
    padding: 12px 14px 12px 28px;
    width: 100%;
    box-sizing: border-box;
}
.cp-tl-list::before {
    content: ''; position: absolute;
    left: 20px; top: 20px; bottom: 20px;
    width: 2px;
    background: rgba(100, 116, 139, 0.18);
    border-radius: 1px;
}

.cp-tl-item {
    position: relative;
    padding-bottom: 16px;
}
.cp-tl-item:last-child { padding-bottom: 0; }

.cp-tl-dot {
    position: absolute;
    left: -15px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg-primary, #0d1025);
    border: 2.5px solid var(--text-muted);
    z-index: 1;
}

.cp-tl-body {
    display: flex; flex-direction: column; gap: 2px;
    padding-left: 6px;
}

.cp-tl-header {
    display: flex; align-items: center; gap: 6px;
}
.cp-tl-icon { display: flex; align-items: center; flex-shrink: 0; }
.cp-tl-icon svg { width: 13px; height: 13px; }
.cp-tl-label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
}

.cp-tl-change {
    font-size: 0.75rem; color: var(--text-secondary);
    padding: 2px 8px; margin: 2px 0;
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
    display: inline-block; width: fit-content;
    font-family: var(--font-mono, monospace);
}

.cp-tl-meta {
    font-size: 0.7rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Generate Product Widget — Minimal Button ──────────────── */
.cp-generate-product-mini {
    display: flex; flex-direction: column; gap: 6px;
}

.gp-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px 16px;
    background: var(--accent-gradient);
    color: white; font-weight: 600; font-size: 0.8125rem;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.3s ease;
}
.gp-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}
.gp-btn:disabled { cursor: not-allowed; }

/* Loading state */
.gp-btn-loading {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    opacity: 0.85;
}

/* Done state — green */
.gp-btn-done {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.3);
}
.gp-btn-done .gp-check svg {
    animation: gp-check-pop 0.4s cubic-bezier(0.2, 0, 0.13, 1);
}

.gp-btn-icon svg, .gp-check svg { width: 16px; height: 16px; }

.gp-spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: gp-spin 0.6s linear infinite;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }
@keyframes gp-check-pop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

.gp-msg {
    padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: 0.75rem; font-weight: 500; text-align: center;
}
.gp-msg-error { background: rgba(248,113,113,0.15); color: var(--danger); }


/* ── Document Card (in chrono feed) ────────────────────────── */
.cp-feed-list {
    display: flex; flex-direction: column; gap: 10px;
}

.cp-doc-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}
.cp-doc-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.cp-doc-card-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex-shrink: 0;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    color: #a5b4fc;
}

.cp-doc-card-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}

.cp-doc-card-name {
    font-size: 0.82rem; font-weight: 600;
    color: #a5b4fc; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; transition: color 0.15s;
}
.cp-doc-card-name:hover { color: #c7d2fe; text-decoration: underline; }

.cp-doc-card-meta {
    font-size: 0.68rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.cp-doc-card-dl, .cp-doc-card-del {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; cursor: pointer;
    color: var(--text-muted);
    opacity: 0; transition: all 0.15s;
}
.cp-doc-card-actions {
    display: flex; gap: 4px; flex-shrink: 0;
}
.cp-doc-card:hover .cp-doc-card-dl,
.cp-doc-card:hover .cp-doc-card-del { opacity: 1; }
.cp-doc-card-dl:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}
.cp-doc-card-del:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: #f87171;
}

/* ── Area Widget ───────────────────────────────────────────── */
.cp-area-widget {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; overflow: hidden;
}
.cp-area-header {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-primary); font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s;
}
.cp-area-header:hover { background: rgba(255,255,255,0.03); }
.cp-area-header-icon { display: flex; color: var(--text-muted); }
.cp-area-header-title { flex: 1; text-align: left; }
.cp-area-chevron {
    display: flex; color: var(--text-muted); transition: transform 0.2s;
}
.cp-area-chevron.open { transform: rotate(180deg); }

.cp-area-loading, .cp-area-empty {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 20px; color: var(--text-muted); font-size: 0.78rem;
}

/* Tile map */
.cp-area-map-wrap { position: relative; overflow: hidden; }
.cp-area-tiles { line-height: 0; }
.cp-area-tiles.dark { filter: invert(1) hue-rotate(180deg) saturate(0.6) brightness(0.85) contrast(1.2); }
.cp-area-tile-grid { display: grid; gap: 0; }
.cp-area-tile { width: 100%; height: auto; display: block; pointer-events: none; }

/* Controls overlay */
.cp-area-controls {
    position: absolute; top: 8px; right: 8px;
    display: flex; flex-direction: column; gap: 4px; z-index: 5;
}
.cp-area-zoom-btns { display: flex; gap: 3px; }
.cp-area-zbtn {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15,15,25,0.8); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 5px;
    color: var(--text-secondary); font-size: 0.65rem; font-weight: 700;
    cursor: pointer; transition: all 0.12s;
}
.cp-area-zbtn:hover { border-color: rgba(99,102,241,0.4); color: white; }
.cp-area-zbtn.active {
    background: rgba(99,102,241,0.5); border-color: rgba(99,102,241,0.6); color: white;
}

/* Info cards */
.cp-area-cards {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 12px;
}
.cp-area-card {
    padding: 4px 10px; border-radius: 8px;
    font-size: 0.68rem; font-weight: 500;
    cursor: pointer; border: 1px solid; transition: all 0.12s;
    background: transparent;
}
.cp-area-card:hover { transform: translateY(-1px); }
.cp-area-card.wiki {
    color: #a5b4fc; border-color: rgba(99,102,241,0.2);
}
.cp-area-card.wiki:hover { background: rgba(99,102,241,0.1); }
.cp-area-card.water {
    color: #38bdf8; border-color: rgba(56,189,248,0.2);
}
.cp-area-card.water:hover { background: rgba(56,189,248,0.1); }
.cp-area-card.sight {
    color: #fbbf24; border-color: rgba(251,191,36,0.2);
}
.cp-area-card.sight:hover { background: rgba(251,191,36,0.1); }
.cp-area-card-title { pointer-events: none; }

/* Popup overlay */
.cp-area-popup-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.cp-area-popup {
    width: 340px; max-width: 90vw; max-height: 60vh;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.cp-area-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--glass-border);
}
.cp-area-popup-header h4 {
    margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
}
.cp-area-popup-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer; padding: 0 4px;
    transition: color 0.1s;
}
.cp-area-popup-close:hover { color: var(--text-primary); }
.cp-area-popup-body {
    padding: 14px 16px; margin: 0;
    font-size: 0.78rem; line-height: 1.6; color: var(--text-secondary);
    overflow-y: auto; max-height: 40vh;
}

/* ── Widget Config Slide-Out (wider variant) ───────────── */
.cf-slide-wide { width: 420px; }

.cf-form-hint {
    display: block; margin-top: 4px;
    font-size: 0.6875rem; color: var(--text-muted); font-style: italic;
}

/* Upload Zone */
.wc-upload-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 28px 16px;
    border: 2px dashed rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    background: rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    cursor: default;
}
.wc-upload-zone:hover,
.wc-upload-zone.drag-over {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}
.wc-upload-icon { color: var(--text-muted); opacity: 0.5; }
.wc-upload-icon svg { width: 28px; height: 28px; }
.wc-upload-text { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.wc-upload-or { font-size: 0.75rem; color: var(--text-muted); }
.wc-upload-btn { cursor: pointer; }
.wc-upload-status {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-size: 0.8125rem; color: var(--text-secondary);
}

/* Template Card */
.wc-template-card {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: rgba(0,0,0,0.1);
}
.wc-template-info {
    display: flex; align-items: center; gap: 10px;
}
.wc-template-icon { flex-shrink: 0; color: var(--accent); }
.wc-template-icon svg { width: 18px; height: 18px; }
.wc-template-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wc-template-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.wc-template-size { font-size: 0.6875rem; color: var(--text-muted); }

/* Placeholder Chips */
.wc-placeholders { margin-top: 10px; }
.wc-ph-label {
    display: block; font-size: 0.6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); margin-bottom: 6px;
}
.wc-ph-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wc-ph-chip {
    display: inline-block; padding: 3px 8px;
    font-size: 0.6875rem; font-family: monospace;
    background: rgba(99, 102, 241, 0.12); color: var(--accent);
    border-radius: var(--radius-sm); border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Settings page */



/* ── Notes List ─────────────────────────────────────────────── */
.cp-notes-list {
    display: flex; flex-direction: column; gap: var(--space-sm);
    margin-top: var(--space-md);
}
.cp-note-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: var(--space-md);
}
.cp-note-pin {
    display: inline-block; font-size: 0.6875rem; font-weight: 600;
    color: var(--warning); background: rgba(251, 191, 36, 0.12);
    padding: 2px 8px; border-radius: var(--radius-full); margin-bottom: var(--space-xs);
}
.cp-note-content {
    font-size: 0.875rem; color: var(--text-primary); white-space: pre-wrap;
    margin-bottom: var(--space-xs);
}
.cp-note-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cp-layout { flex-direction: column; }
    .cp-left { width: 100%; }
    .cp-pipeline-bar { flex-wrap: wrap; }
    .cp-pills-area { min-width: 0; }
    .cp-pill-label { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */
.admin-section { margin-top: var(--space-lg); }

/* Tab Navigation */
.admin-tabs {
    display: flex; gap: 4px; padding: 4px;
    background: rgba(0,0,0,0.2); border-radius: var(--radius-md);
    margin-bottom: var(--space-lg); overflow-x: auto;
}
.admin-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--text-muted);
    font-size: 0.85rem; cursor: pointer; white-space: nowrap;
    transition: all 0.2s;
}
.admin-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.admin-tab-active {
    color: var(--text-primary); background: rgba(99,102,241,0.15);
    font-weight: 600;
}
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab-content { min-height: 300px; }
.admin-section-header {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
    margin-bottom: var(--space-xl); padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border); flex-wrap: wrap;
}
.admin-section-header h2 {
    margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2;
}
.admin-section-header .text-muted {
    margin: var(--space-xs) 0 0; font-size: 0.875rem; color: var(--text-secondary);
}

/* Group cards grid */
.admin-groups-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════
   E-MAIL POSTFACH (self-service IMAP/SMTP connect)
   ═══════════════════════════════════════════════════════════════ */
.eacc-panel { grid-column: 1 / -1; }
.eacc-hint {
    font-size: 0.8125rem; color: var(--text-muted);
    margin: 0 0 var(--space-md); line-height: 1.45;
}
.eacc-form { display: flex; flex-direction: column; gap: var(--space-md); }
.eacc-hp { display: flex; gap: var(--space-sm); }
.eacc-hp .input-field:first-child { flex: 1; }
.eacc-port { width: 96px; flex: 0 0 auto; }
.eacc-actions {
    display: flex; align-items: center; gap: var(--space-sm);
    flex-wrap: wrap; margin-top: var(--space-xs);
}
.eacc-feedback { font-size: 0.8125rem; }
.eacc-feedback.ok  { color: var(--success, #34d399); }
.eacc-feedback.err { color: var(--danger, #f87171); }

/* Connection status pill in the section header */
.eacc-badge {
    margin-left: auto; font-size: 0.6875rem; font-weight: 600;
    padding: 3px 10px; border-radius: var(--radius-full);
    text-transform: uppercase; letter-spacing: 0.02em;
}
.eacc-badge.ok   { color: #34d399; background: rgba(52, 211, 153, 0.14); }
.eacc-badge.warn { color: #fbbf24; background: rgba(251, 191, 36, 0.14); }
.eacc-badge.err  { color: #f87171; background: rgba(248, 113, 113, 0.14); }
.eacc-badge.off  { color: var(--text-muted); background: rgba(148, 163, 184, 0.12); }

.eacc-privacy {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer;
    margin-top: var(--space-xs);
}
.eacc-privacy input { margin-top: 3px; }
.eacc-privacy-hint { color: var(--text-muted); }


/* ============================================================
   User settings — extras on top of the shared admin `.ms-*`
   window/toolkit (window shell, rows, groups, switches, save
   button, segmented controls all come from
   styles/admin/_admin_settings_window.css). Only user-specific
   pieces live here: the profile identity card, colour swatches,
   the password form and small status helpers. Prefix: .us-*
   ============================================================ */

/* ── Profil: identity card ───────────────────────────────── */
.us-identity {
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 11px;
    margin-bottom: 18px;
}
.us-identity-avatar {
    flex: none;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient); color: #fff;
    font-size: 1.35rem; font-weight: 700;
}
.us-identity-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.us-identity-name {
    font-size: 1.05rem; font-weight: 650; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.us-identity-mail {
    font-size: 0.85rem; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.us-role-badge {
    align-self: flex-start; margin-top: 3px;
    padding: 2px 9px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--text-accent);
    font-size: 0.7rem; font-weight: 600;
}

/* ── Darstellung: accent-colour swatches ─────────────────── */
.us-swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.us-swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer; padding: 0;
    transition: transform 0.12s, border-color 0.12s;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset;
}
.us-swatch:hover { transform: scale(1.1); }
.us-swatch.on {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ── Password form + status helpers ──────────────────────── */
.us-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.us-field { display: flex; flex-direction: column; gap: 5px; }
.us-field-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.us-field input {
    width: 100%; padding: 9px 11px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary); font-size: 0.88rem;
}
.us-field input:focus { outline: none; border-color: var(--accent); }
.us-hint { font-size: 0.78rem; color: var(--text-muted); }
.us-ok { font-size: 0.85rem; color: var(--success); }
.us-error { font-size: 0.85rem; color: var(--danger); }

/* ── Hintergrund: collectible background picker ──────────── */
.us-bg-section { margin-top: 26px; }
.us-bg-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.us-bg-card {
    position: relative; aspect-ratio: 16 / 10;
    border-radius: var(--radius-md); overflow: hidden;
    border: 2px solid var(--glass-border);
    background: var(--bg-input); padding: 0; cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
}
.us-bg-card:hover { transform: translateY(-2px); border-color: var(--glass-border-hover); }
.us-bg-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.us-bg-card.locked { cursor: not-allowed; }
.us-bg-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.us-bg-card.locked .us-bg-thumb { filter: grayscale(0.7) brightness(0.5); }
/* caption bar */
.us-bg-cap {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 6px;
    padding: 14px 8px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}
.us-bg-name {
    flex: 1; min-width: 0;
    font-size: 0.76rem; font-weight: 600; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
/* tier badge */
.us-bg-tier {
    flex: none; padding: 1px 7px; border-radius: var(--radius-full);
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.us-bg-tier.bronze  { background: rgba(180, 120, 70, 0.9); color: #fff; }
.us-bg-tier.silver  { background: rgba(160, 174, 192, 0.9); color: #12203a; }
.us-bg-tier.gold    { background: rgba(234, 179, 8, 0.92); color: #3a2c00; }
.us-bg-tier.special { background: var(--accent-gradient); color: #fff; }
/* locked overlay: centered lock + requirement */
.us-bg-lock {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; padding: 8px; text-align: center;
    background: rgba(6, 10, 20, 0.45);
}
.us-bg-lock svg { width: 18px; height: 18px; color: #e2e8f0; }
.us-bg-lock-req {
    font-size: 0.68rem; color: #e2e8f0; font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
/* "no background" tile */
.us-bg-none {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
    background: var(--bg-input);
}
.us-bg-none.selected { color: var(--text-accent); }

/* ── Danger action (log out everywhere) ──────────────────── */
.us-danger-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: var(--danger); font-weight: 600; font-size: 0.86rem;
    cursor: pointer; transition: all 0.12s;
}
.us-danger-btn:hover { background: rgba(248, 113, 113, 0.2); }

/* Login — admin-enforced 2FA enrollment (QR for Microsoft Authenticator) */

/* Scanners want the QR on white — a deliberate light island in the dark UI. */
.tfa-qr {
    background: #fff; padding: var(--space-sm);
    border-radius: var(--radius-md); line-height: 0;
}
.tfa-qr svg { width: 148px; height: 148px; }
.tfa-qr-center { align-self: center; }

.tfa-secret {
    font-family: var(--font-mono); font-size: 0.8125rem;
    color: var(--text-primary); background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    word-break: break-all; user-select: all; text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   TEAM-POSTFACH  (/inbox) — Cockpit-Optik wie die Kampagnen-Seiten:
   Pill-Tabs über einer Glass-Shell (Konversationen links · Thread
   rechts mit Aktionsleiste, KI-Panel und Composer).
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar ────────────────────────────────────────────────────── */
.ib-topbar { display: flex; align-items: center; gap: var(--space-md); flex: 1; }
.ib-topbar-title { font-weight: 600; color: var(--text-primary); }
.ib-status {
    font-size: 0.8rem; color: var(--success);
    background: rgba(52, 211, 153, 0.12); border-radius: var(--radius-full);
    padding: 3px 12px; animation: fadeIn 0.15s ease;
}
.ib-status.is-err { color: var(--danger); background: rgba(248, 113, 113, 0.12); }
.ib-btn-ic { display: inline-flex; width: 1rem; height: 1rem; flex: 0 0 auto; }
.ib-btn-ic svg { width: 100%; height: 100%; }

/* ── Seite + Pill-Tabs ─────────────────────────────────────────── */
.ib-page { height: 100%; display: flex; flex-direction: column; gap: var(--space-md); }
.ib-tabs {
    display: inline-flex; gap: 2px; align-self: flex-start; flex-wrap: wrap;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 3px;
}
.ib-tab {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: 0; cursor: pointer;
    padding: 7px 16px; border-radius: 8px;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    font-family: var(--font-sans); transition: all var(--transition-fast);
}
.ib-tab:hover { color: var(--text-primary); }
.ib-tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4); }
.ib-tab-count {
    font-size: 0.68rem; font-weight: 700; line-height: 1;
    background: rgba(148, 163, 184, 0.18); color: var(--text-secondary);
    border-radius: var(--radius-full); padding: 3px 7px;
}
.ib-tab-count.is-hot { background: rgba(99, 102, 241, 0.22); color: var(--text-accent); }
.ib-tab.is-active .ib-tab-count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ── Shell: EINE Glass-Fläche, drei Spalten (Outlook-Muster) ───── */
.ib-shell {
    flex: 1; min-height: 0; padding: 0; overflow: hidden;
    display: grid; grid-template-columns: 218px 350px minmax(0, 1fr);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
}

/* ── Ordner-Leiste (links) ─────────────────────────────────────── */
.ib-rail {
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--space-md) var(--space-sm);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
}
.ib-rail-new {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    margin-bottom: var(--space-md); padding: 9px 12px; font-size: 0.875rem;
}
.ib-rail-sec {
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text-muted);
    padding: var(--space-sm) var(--space-sm) 4px;
}
.ib-folder {
    display: flex; align-items: center; gap: 9px; text-align: left;
    padding: 7px var(--space-sm); border-radius: var(--radius-sm);
    background: none; border: 0; cursor: pointer;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
    font-family: var(--font-sans); transition: all var(--transition-fast);
}
.ib-folder:hover { background: var(--bg-hover); color: var(--text-primary); }
.ib-folder.is-active {
    background: rgba(99, 102, 241, 0.14); color: var(--text-primary);
    font-weight: 600; box-shadow: inset 2px 0 0 var(--accent);
}
.ib-folder-ic { display: inline-flex; width: 15px; height: 15px; flex: 0 0 auto; color: var(--text-muted); }
.ib-folder.is-active .ib-folder-ic { color: var(--text-accent); }
.ib-folder-ic svg { width: 100%; height: 100%; }
.ib-folder-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-folder-count {
    font-size: 0.68rem; font-weight: 700; line-height: 1;
    background: rgba(99, 102, 241, 0.2); color: var(--text-accent);
    border-radius: var(--radius-full); padding: 3px 7px; flex: 0 0 auto;
}
.ib-loading, .ib-none, .ib-none-sel {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.875rem; padding: var(--space-2xl);
}
.ib-none-sel { flex-direction: column; gap: var(--space-sm); height: 100%; }
.ib-none-ic { display: inline-flex; width: 30px; height: 30px; color: var(--text-muted); opacity: 0.6; }
.ib-none-ic svg { width: 100%; height: 100%; }

/* Leerzustand (kein Postfach verbunden) */
.ib-empty-state {
    grid-column: 1 / -1; align-self: center; justify-self: center;
    display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
    text-align: center; padding: var(--space-2xl);
}
.ib-empty-icon {
    display: inline-flex; width: 44px; height: 44px; color: var(--text-accent);
    background: rgba(99, 102, 241, 0.12); border-radius: var(--radius-full);
    align-items: center; justify-content: center; padding: 10px;
}
.ib-empty-icon svg { width: 24px; height: 24px; }
.ib-empty-title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.ib-empty-text { font-size: 0.88rem; color: var(--text-muted); max-width: 34rem; line-height: 1.5; margin: 0; }

/* ── Linke Spalte: Suche + Konversationsliste ──────────────────── */
.ib-listcol {
    display: flex; flex-direction: column; min-height: 0;
    border-right: 1px solid var(--glass-border);
}
.ib-search {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-md); border-bottom: 1px solid var(--glass-border);
}
.ib-search-ic { display: inline-flex; width: 15px; height: 15px; color: var(--text-muted); flex: 0 0 auto; }
.ib-search-ic svg { width: 100%; height: 100%; }
.ib-search-input {
    flex: 1; min-width: 0; background: none; border: 0; outline: none;
    color: var(--text-primary); font-size: 0.875rem; font-family: var(--font-sans);
}
.ib-search-input::placeholder { color: var(--text-muted); }
.ib-uchip {
    flex: 0 0 auto; font-size: 0.72rem; font-weight: 600;
    padding: 4px 10px; border-radius: var(--radius-full); cursor: pointer;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-family: var(--font-sans);
    transition: all var(--transition-fast);
}
.ib-uchip:hover { color: var(--text-primary); }
.ib-uchip.is-on { background: var(--accent); border-color: transparent; color: #fff; }
.ib-rows { flex: 1; overflow-y: auto; padding: var(--space-xs); display: flex; flex-direction: column; gap: 2px; }

/* Outlook-Datumsgruppen („Angeheftet" · Heute · Gestern · …) */
.ib-group {
    position: sticky; top: 0; z-index: 5;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding: 7px var(--space-sm) 4px;
    background: rgba(10, 14, 26, 0.86); backdrop-filter: blur(8px);
}

.ib-row {
    position: relative;
    display: flex; gap: var(--space-sm); align-items: flex-start;
    padding: 10px var(--space-sm); border-radius: var(--radius-md);
    cursor: pointer; transition: background var(--transition-fast);
    border: 1px solid transparent;
}
.ib-row:hover { background: var(--bg-hover); }

/* Hover-Aktionen (Outlook: ersetzen oben rechts den Zeitstempel) */
.ib-row-acts {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    display: none; gap: 2px;
    background: rgba(10, 14, 26, 0.92); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: 2px;
}
.ib-row:hover .ib-row-acts { display: inline-flex; }
.ib-row:hover .ib-when { visibility: hidden; }
.ib-rowbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: var(--radius-sm);
    background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); transition: all var(--transition-fast);
}
.ib-rowbtn:hover { background: var(--bg-hover); color: var(--text-primary); }
.ib-rowbtn.is-on { color: var(--warning); }
.ib-rowbtn svg { width: 14px; height: 14px; }
.ib-pin-ic { display: inline-flex; width: 12px; height: 12px; color: var(--warning); flex: 0 0 auto; }
.ib-pin-ic svg { width: 12px; height: 12px; }
.ib-row.is-sel {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.28);
}

/* Avatar: stabiler Farbton je Adresse (–ib-h), Unread-Dot als ::after */
.ib-ava {
    position: relative; flex: 0 0 auto;
    width: 34px; height: 34px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
    background: hsla(var(--ib-h, 230), 60%, 55%, 0.2);
    border: 1px solid hsla(var(--ib-h, 230), 60%, 62%, 0.35);
    color: hsl(var(--ib-h, 230), 72%, 76%);
}
.ib-row.is-unread .ib-ava::after {
    content: ''; position: absolute; top: -2px; right: -2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 6px var(--accent-glow, rgba(99, 102, 241, 0.6));
}

.ib-row-main { flex: 1; min-width: 0; }
.ib-row-top { display: flex; justify-content: space-between; gap: var(--space-sm); }
.ib-who {
    font-size: 0.8125rem; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ib-when { font-size: 0.6875rem; color: var(--text-muted); flex: 0 0 auto; }
.ib-subj {
    display: flex; align-items: center; gap: 6px; margin-top: 1px;
    font-size: 0.8125rem; color: var(--text-secondary); min-width: 0;
}
.ib-subj-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-row.is-unread .ib-who,
.ib-row.is-unread .ib-subj-text { font-weight: 700; color: var(--text-primary); }
.ib-count {
    flex: 0 0 auto; font-size: 0.625rem; font-weight: 600; color: var(--text-muted);
    background: rgba(148, 163, 184, 0.16); border-radius: var(--radius-full); padding: 0 6px;
}
.ib-clip { display: inline-flex; width: 12px; height: 12px; color: var(--text-muted); flex: 0 0 auto; }
.ib-clip svg { width: 12px; height: 12px; }
.ib-snip {
    font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Chips (Liste + Thread-Kopf teilen das Vokabular) */
.ib-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; }
.ib-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.01em;
    padding: 2px 8px; border-radius: var(--radius-full);
    background: rgba(148, 163, 184, 0.14); color: var(--text-secondary);
    border: 1px solid transparent; text-decoration: none;
}
.ib-chip-ic { display: inline-flex; }
.ib-chip-ic svg, .ib-menu-ic svg { width: 12px; height: 12px; }
.ib-chip-camp { color: var(--text-accent); background: rgba(99, 102, 241, 0.14); }
.ib-chip-open {
    color: var(--warning); background: rgba(251, 191, 36, 0.14);
    text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.04em;
}
.ib-chip-snooze { color: var(--warning); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.2); }
.ib-chip-user { color: var(--text-secondary); background: rgba(148, 163, 184, 0.14); }
.ib-chip-nav { color: var(--text-accent); background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.25); cursor: pointer; }
.ib-chip-nav:hover { background: rgba(99, 102, 241, 0.2); }

/* Intent-Tönung (eigenständig — campaigns-tone-* ist dort gescoped) */
.ib-intent.tone-good   { color: var(--success); background: rgba(52, 211, 153, 0.14); }
.ib-intent.tone-accent { color: var(--text-accent); background: rgba(99, 102, 241, 0.14); }
.ib-intent.tone-bad    { color: var(--danger); background: rgba(248, 113, 113, 0.14); }
.ib-intent.tone-muted  { color: var(--text-muted); background: rgba(148, 163, 184, 0.14); }

/* ── Rechte Spalte: Thread ─────────────────────────────────────── */
.ib-threadcol { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-thread { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.ib-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--space-md); padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.ib-head-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ib-head-subj {
    font-size: 1rem; font-weight: 600; color: var(--text-primary);
    letter-spacing: -0.01em; line-height: 1.3;
}
.ib-head-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.ib-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: flex-end; }
.ib-act { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; padding: 6px 12px; }
.ib-act.is-done { color: var(--success); border-color: rgba(52, 211, 153, 0.4); }

/* Aufklapp-Menüs (Zuweisen / Wiedervorlage) */
.ib-menuwrap { position: relative; }
.ib-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
    min-width: 15.5rem; max-height: 300px; overflow-y: auto;
    display: flex; flex-direction: column; padding: 4px;
    background: var(--glass-bg); backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.ib-menu-item {
    display: flex; align-items: center; gap: 8px; text-align: left;
    padding: 8px 10px; font-size: 0.85rem; color: var(--text-secondary);
    background: transparent; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-family: var(--font-sans); white-space: nowrap;
}
.ib-menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.ib-menu-item.is-strong { color: var(--text-accent); font-weight: 600; }
.ib-menu-item.is-current { color: var(--text-primary); background: rgba(99, 102, 241, 0.1); }
.ib-menu-item.is-danger { color: var(--danger); }
.ib-menu-item.is-danger:hover { background: rgba(248, 113, 113, 0.12); }
.ib-menu-ic { display: inline-flex; color: currentColor; flex: 0 0 auto; }
.ib-menu-sub { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }

/* Nachrichten */
.ib-msgs {
    flex: 1; overflow-y: auto; min-height: 0;
    padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md);
}
.ib-msg {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md);
    box-shadow: var(--shadow-inner-glow);
}
.ib-msg.out { border-left: 3px solid #8b5cf6; }
.ib-msg.in  { border-left: 3px solid #10b981; }
.ib-msg-head { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.ib-msg-ava {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: var(--radius-full);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
    background: hsla(var(--ib-h, 230), 60%, 55%, 0.2);
    border: 1px solid hsla(var(--ib-h, 230), 60%, 62%, 0.35);
    color: hsl(var(--ib-h, 230), 72%, 76%);
}

/* Eingeklappte ältere Nachricht (Outlook-Konversationsmuster) */
.ib-msg-collapsed {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 8px var(--space-md); cursor: pointer;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); opacity: 0.75;
    transition: all var(--transition-fast);
}
.ib-msg-collapsed:hover { opacity: 1; border-color: var(--glass-border-hover); }
.ib-msgc-who {
    flex: 0 0 auto; max-width: 14rem; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
}
.ib-msgc-snip {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 0.78rem; color: var(--text-muted);
}
.ib-tag {
    font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: var(--radius-full); letter-spacing: 0.03em;
}
.ib-tag.in  { color: #10b981; background: rgba(16, 185, 129, 0.14); }
.ib-tag.out { color: #8b5cf6; background: rgba(139, 92, 246, 0.14); }
.ib-msg-who { font-size: 0.8125rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.ib-msg-when { font-size: 0.6875rem; color: var(--text-muted); margin-left: auto; flex: 0 0 auto; }
.ib-msg-subj { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-top: var(--space-xs); }
.ib-msg-body {
    font-size: 0.875rem; color: var(--text-secondary); white-space: pre-wrap;
    margin: var(--space-sm) 0 0; line-height: 1.55;
}

.ib-atts { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.ib-att {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.75rem; color: var(--text-accent);
    background: rgba(99, 102, 241, 0.1); border-radius: var(--radius-sm);
    padding: 4px 10px; text-decoration: none;
}
.ib-att:hover { background: rgba(99, 102, 241, 0.2); }
.ib-att span { display: inline-flex; width: 13px; height: 13px; }
.ib-att svg { width: 13px; height: 13px; }

/* KI-Panel (Kampagnen-Antwort mit Analyse/Vorschlag) */
.ib-ai {
    margin: 0 var(--space-lg) var(--space-md); padding: var(--space-md);
    background: rgba(99, 102, 241, 0.06); border: 1px solid rgba(99, 102, 241, 0.22);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-md);
    display: flex; flex-direction: column; gap: var(--space-sm);
}
.ib-ai-head { display: flex; align-items: flex-start; gap: var(--space-sm); flex-wrap: wrap; }
.ib-ai-badge {
    display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-accent);
}
.ib-ai-summary { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
.ib-ai-use { align-self: flex-start; font-size: 0.8rem; }

/* Composer */
.ib-reply {
    border-top: 1px solid var(--glass-border);
    padding: var(--space-md) var(--space-lg);
    display: flex; flex-direction: column; gap: var(--space-sm);
}
.ib-reply-body { min-height: 84px; resize: vertical; font-family: inherit; }
.ib-reply-foot { display: flex; align-items: center; gap: var(--space-md); }
.ib-replyall {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer;
}
.ib-send { display: inline-flex; align-items: center; gap: 6px; }

/* ── „Neue E-Mail"/Weiterleiten-Modal ──────────────────────────── */
.ib-modal-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(4, 6, 14, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-lg);
}
.ib-modal {
    width: 100%; max-width: 34rem; max-height: 86vh;
    display: flex; flex-direction: column;
    background: var(--glass-bg); backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg, var(--shadow-md));
    overflow: hidden;
}
.ib-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-md); padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.ib-modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.ib-modal-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
}
.ib-modal-x:hover { background: var(--bg-hover); color: var(--text-primary); }
.ib-modal-x svg { width: 15px; height: 15px; }
.ib-modal-body {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding: var(--space-lg); overflow-y: auto;
}
.ib-modal-text { min-height: 180px; resize: vertical; font-family: inherit; line-height: 1.5; }
.ib-modal-err {
    font-size: 0.82rem; color: var(--danger);
    background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
}
.ib-modal-foot {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--glass-border);
}

/* ── Responsive: Spalten stapeln ───────────────────────────────── */
@media (max-width: 1180px) {
    .ib-shell { grid-template-columns: 190px 320px minmax(0, 1fr); }
}
@media (max-width: 980px) {
    .ib-page { height: auto; }
    .ib-shell { display: flex; flex-direction: column; }
    .ib-rail {
        flex-direction: row; flex-wrap: wrap; align-items: center;
        border-right: none; border-bottom: 1px solid var(--glass-border);
    }
    .ib-rail-new { margin-bottom: 0; }
    .ib-rail-sec { display: none; }
    .ib-listcol { border-right: none; border-bottom: 1px solid var(--glass-border); }
    .ib-rows { max-height: 38vh; }
    .ib-head { flex-direction: column; }
    .ib-actions { justify-content: flex-start; }
}

/* Direction chip on the contact/company feed email card (email_received). */
.cp-email-dir {
    font-size: 0.625rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--text-muted);
    background: rgba(148, 163, 184, 0.14); border-radius: var(--radius-full);
    padding: 1px 7px; margin-left: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   ORDNER · ENTWÜRFE · KONTEXTMENÜ · VERWALTUNGS-MODALS
   (Entwürfe, Archiv, benutzerdefinierte Ordner + Regeln, Rechtsklick)
   ═══════════════════════════════════════════════════════════════ */

/* ── Rail: Ordner-Sektion mit Verwalten-Button + custom Ordner ─── */
.ib-rail-sec-row {
    display: flex; align-items: center; justify-content: space-between;
    padding-right: 4px;
}
.ib-rail-manage, .ib-rail-rules-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border: 0; background: transparent;
    color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
}
.ib-rail-manage:hover { color: var(--text-primary); background: var(--bg-hover); }
.ib-rail-manage svg { width: 14px; height: 14px; }
.ib-rail-empty {
    font-size: 0.78rem; color: var(--text-muted); font-style: italic;
    padding: 4px var(--space-sm) 6px;
}
.ib-rail-rules { margin-top: 6px; opacity: 0.9; }
.ib-rail-rules .ib-folder-ic { color: var(--text-muted); }
/* Farbpunkt eines benutzerdefinierten Ordners (statt Icon). */
.ib-folder-dot {
    flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
    margin: 0 2px 0 3px;
}

/* ── Entwurfs-Zeile in der Liste ───────────────────────────────── */
.ib-draft-row .ib-ava-draft {
    background: rgba(148, 163, 184, 0.16);
    border-color: var(--glass-border); color: var(--text-muted);
}
.ib-ava-draft { display: inline-flex; align-items: center; justify-content: center; }
.ib-ava-draft svg { width: 15px; height: 15px; }
.ib-draft-tag {
    display: inline-block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--warning);
    background: rgba(251, 191, 36, 0.14); border-radius: var(--radius-full);
    padding: 1px 7px; margin-right: 6px;
}

/* ── Rechtsklick-Kontextmenü ───────────────────────────────────── */
.ib-ctxmenu {
    position: fixed; z-index: 80; min-width: 14rem;
    display: flex; flex-direction: column; padding: 4px;
    background: var(--glass-bg); backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg, var(--shadow-md));
    animation: fadeIn 0.1s ease;
}
.ib-menu-sep { height: 1px; background: var(--glass-border); margin: 4px 2px; }
.ib-submenu-anchor { position: relative; }
.ib-menu-more { justify-content: flex-start; }
.ib-menu-chev { display: inline-flex; margin-left: auto; color: var(--text-muted); }
.ib-menu-chev svg { width: 14px; height: 14px; }
/* Untermenü „Verschieben nach" — rechts am Anker angedockt. */
.ib-submenu {
    position: absolute; left: calc(100% + 4px); top: -4px;
    min-width: 12rem; max-height: 280px; overflow-y: auto;
}
.ib-menu-empty { font-size: 0.8rem; color: var(--text-muted); padding: 8px 10px; }

/* ── Modal-Breiten ─────────────────────────────────────────────── */
.ib-modal-narrow { max-width: 26rem; }
.ib-modal-wide { max-width: 42rem; }

/* ── Ordner-Verwaltung ─────────────────────────────────────────── */
.ib-fld-new {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding-bottom: var(--space-md); border-bottom: 1px solid var(--glass-border);
    margin-bottom: var(--space-md);
}
.ib-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-swatch {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: transform var(--transition-fast);
}
.ib-swatch:hover { transform: scale(1.12); }
.ib-swatch.is-on { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-body, #0b0e17); }
.ib-fld-newrow { display: flex; gap: var(--space-sm); }
.ib-fld-newrow .input-field { flex: 1; }
.ib-fld-list { display: flex; flex-direction: column; gap: 2px; }
.ib-fld-row {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 7px var(--space-sm); border-radius: var(--radius-sm);
}
.ib-fld-row:hover { background: var(--bg-hover); }
.ib-fld-name { flex: 1; font-size: 0.875rem; color: var(--text-primary); }
.ib-fld-edit { flex: 1; padding: 4px 8px; font-size: 0.85rem; }
.ib-rowbtn-danger:hover { color: var(--danger); background: rgba(248, 113, 113, 0.12); }

/* ── Regeln-Verwaltung ─────────────────────────────────────────── */
.ib-rules-apply { margin-left: auto; margin-right: var(--space-sm); font-size: 0.8rem; }
.ib-rules-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-md); }
.ib-rule-row {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm); border-radius: var(--radius-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.ib-rule-row.is-off { opacity: 0.55; }
.ib-rule-body { flex: 1; min-width: 0; }
.ib-rule-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.ib-rule-desc { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
/* Aktiv-Schalter (Pill). */
.ib-rule-toggle {
    flex: 0 0 auto; width: 34px; height: 19px; border-radius: var(--radius-full);
    background: rgba(148, 163, 184, 0.3); border: 0; cursor: pointer; position: relative;
    transition: background var(--transition-fast);
}
.ib-rule-toggle.is-on { background: var(--accent); }
.ib-rule-knob {
    position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
    border-radius: 50%; background: #fff; transition: left var(--transition-fast);
}
.ib-rule-toggle.is-on .ib-rule-knob { left: 17px; }
/* Neue-Regel-Formular. */
.ib-rule-form {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding: var(--space-md); border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.05); border: 1px solid var(--glass-border);
}
.ib-rule-formtitle { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.ib-rule-when, .ib-rule-then { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.ib-rule-when .input-field, .ib-rule-then .input-field { flex: 1; min-width: 8rem; }
.ib-rule-lead {
    flex: 0 0 auto; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-accent); width: 3rem;
}
.ib-rule-formfoot { display: flex; justify-content: flex-end; }

/* ── Kampagnen (Cold Outreach) ─────────────────────────────────────────────
   Liste (Karten + Funnel) → Detail (Sequenz-Editor / Empfänger) + Zustellbarkeit
   + Suppression. Nutzt die globalen Tokens/Buttons/Modals; hier Seiten-Feinschliff
   im CRM-Look (Glass, Schatten, Glow-Hover, Akzent-Gradient). */

.cmp-page { display: flex; flex-direction: column; gap: var(--space-xl); }

/* Topbar */
.cmp-topbar { display: flex; align-items: center; gap: var(--space-md); }
.cmp-topbar-title { font-weight: 600; color: var(--text-primary); }
.cmp-status {
    font-size: 0.8rem; font-weight: 600; color: var(--success);
    padding: 3px 10px; border-radius: var(--radius-full);
    background: rgba(52, 211, 153, 0.12);
}
.cmp-status.is-err { color: var(--danger); background: rgba(248, 113, 113, 0.12); }

/* Listen-Ebene: Titel + Seiten-Tabs (Kampagnen | Zustellbarkeit | Blockliste) */
.cmp-list-view { display: flex; flex-direction: column; gap: var(--space-lg); }
.cmp-page-title { margin: 0; }
.cmp-pagetabs { align-self: flex-start; margin-bottom: var(--space-xs); }
.cmp-btn-icon { display: inline-flex; width: 1rem; height: 1rem; }
.cmp-btn-icon svg { width: 100%; height: 100%; }

/* Werkzeug-Panel (Zustellbarkeit / Blockliste) */
.cmp-panel {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    display: flex; flex-direction: column; gap: var(--space-md);
}
.cmp-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-lg); }
.cmp-panel-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.cmp-panel-sub { font-size: 0.84rem; color: var(--text-muted); margin: 4px 0 0; max-width: 46rem; line-height: 1.5; }

/* Einladender Leerzustand */
.cmp-empty-state {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: var(--space-md); padding: var(--space-2xl) var(--space-lg);
    background: var(--glass-bg); border: 1px dashed var(--glass-border);
    border-radius: var(--radius-lg);
}
.cmp-empty-icon {
    width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--text-accent);
}
.cmp-empty-icon svg { width: 28px; height: 28px; }
.cmp-empty-title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.cmp-empty-text { font-size: 0.88rem; color: var(--text-muted); max-width: 30rem; line-height: 1.5; margin: 0; }

/* ── Karten-Grid ─────────────────────────────────────────────────────────── */
.cmp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--space-lg);
}
.cmp-card {
    position: relative; overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: all var(--transition-normal);
    animation: cardEnter 0.4s var(--ease-standard) backwards;
}
/* Subtiler Akzent-Streifen oben, sichtbar bei Hover */
.cmp-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: var(--accent-gradient); opacity: 0; transition: opacity var(--transition-normal);
}
.cmp-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-3px);
}
.cmp-card:hover::before { opacity: 1; }
.cmp-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.cmp-card-name { font-weight: 600; font-size: 0.975rem; color: var(--text-primary); letter-spacing: -0.01em; }
.cmp-card-meta { margin-top: 4px; font-size: 0.78rem; color: var(--text-muted); }

/* ── Status-Badges (Kampagne + Empfänger teilen das Vokabular) ─────────────── */
.cmp-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
    border-radius: var(--radius-full); white-space: nowrap;
    background: rgba(148, 163, 184, 0.12); color: var(--text-secondary);
    border: 1px solid transparent;
}
.cmp-badge.st-active { background: rgba(52, 211, 153, 0.13); color: var(--success); border-color: rgba(52, 211, 153, 0.25); }
.cmp-badge.st-paused { background: rgba(251, 191, 36, 0.13); color: var(--warning); border-color: rgba(251, 191, 36, 0.25); }
.cmp-badge.st-completed,
.cmp-badge.st-finished { background: rgba(99, 102, 241, 0.14); color: var(--text-accent); border-color: rgba(99, 102, 241, 0.28); }
.cmp-badge.st-replied { background: rgba(52, 211, 153, 0.13); color: var(--success); border-color: rgba(52, 211, 153, 0.25); }
.cmp-badge.st-bounced,
.cmp-badge.st-unsubscribed,
.cmp-badge.st-stopped { background: rgba(248, 113, 113, 0.11); color: var(--danger); border-color: rgba(248, 113, 113, 0.22); }

/* ── Mini-Funnel auf der Karte ─────────────────────────────────────────────── */
.cmp-funnel {
    display: flex; gap: 0; margin-top: var(--space-lg);
    padding-top: var(--space-md); border-top: 1px solid var(--glass-border);
}
.cmp-funnel-cell {
    display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0;
    padding: 0 var(--space-sm);
}
.cmp-funnel-cell + .cmp-funnel-cell { border-left: 1px solid var(--glass-border); }
.cmp-funnel-value { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.cmp-funnel-label { font-size: 0.68rem; color: var(--text-muted); }

/* Farbcodierte Kennzahlen (Funnel + Stat teilen die Töne) */
.tone-good .cmp-funnel-value,  .cmp-stat.tone-good  .cmp-stat-value  { color: var(--success); }
.tone-accent .cmp-funnel-value, .cmp-stat.tone-accent .cmp-stat-value { color: var(--text-accent); }
.tone-bad .cmp-funnel-value,   .cmp-stat.tone-bad   .cmp-stat-value  { color: var(--danger); }

/* ── Kennzahlen-Reihe im Detail (Stat-Cards) ───────────────────────────────── */
.cmp-stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: var(--space-md); margin-top: var(--space-md);
}
.cmp-stat {
    position: relative; overflow: hidden;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg);
    display: flex; flex-direction: column; gap: 2px;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: all var(--transition-normal);
}
.cmp-stat:hover { border-color: var(--glass-border-hover); box-shadow: var(--shadow-glow), var(--shadow-md); transform: translateY(-2px); }
.cmp-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1.15; }
.cmp-stat-label { font-size: 0.72rem; color: var(--text-muted); }

/* ── Übersicht-Tab: Startcheckliste (Entwurf) ──────────────────────────────── */
.cmp-overview { display: flex; flex-direction: column; gap: var(--space-lg); }
.cmp-checklist {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    display: flex; flex-direction: column; gap: var(--space-sm); max-width: 44rem;
}
.cmp-checklist-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-xs); }
.cmp-check-row {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md); border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--glass-border-subtle);
}
.cmp-check-mark {
    width: 26px; height: 26px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.cmp-check-ic { display: inline-flex; }
.cmp-check-ic svg { width: 20px; height: 20px; }
.cmp-check-ring {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid currentColor; opacity: 0.55;
}
.cmp-check-row.is-ok .cmp-check-mark {
    color: var(--success); filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.35));
}
.cmp-check-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cmp-check-title { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.cmp-check-detail { font-size: 0.8rem; color: var(--text-muted); }
.cmp-check-go { font-size: 0.8rem; padding: 5px 14px; flex: 0 0 auto; }
.cmp-checklist-foot { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); flex-wrap: wrap; }
.cmp-start-btn { font-size: 0.95rem; padding: var(--space-sm) var(--space-xl); }
.cmp-checklist-hint { font-size: 0.8rem; color: var(--text-muted); }
.cmp-resume { margin-top: var(--space-md); }

/* ── Detail-Kopf + Tabs ────────────────────────────────────────────────────── */
.cmp-detail { display: flex; flex-direction: column; gap: var(--space-lg); }
.cmp-back { align-self: flex-start; color: var(--text-secondary); }
.cmp-detail-title-row { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-xs); }
.cmp-actions { margin-left: auto; display: flex; gap: var(--space-sm); }
.cmp-danger { color: var(--danger); }
.cmp-danger:hover:not(:disabled) { color: var(--danger); background: rgba(248, 113, 113, 0.1); }

/* Segment-Tabs (Pille wie im CRM) */
.cmp-tabs {
    display: inline-flex; gap: 2px; align-self: flex-start;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 3px;
}
.cmp-tab {
    background: none; border: 0; cursor: pointer;
    padding: 7px 18px; border-radius: 8px;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    font-family: var(--font-sans); transition: all var(--transition-fast);
}
.cmp-tab:hover { color: var(--text-primary); }
.cmp-tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4); }

/* ── Sequenz-Editor ────────────────────────────────────────────────────────── */
.cmp-editor { display: flex; flex-direction: column; gap: var(--space-md); }
.cmp-editor-locked {
    font-size: 0.82rem; color: var(--warning);
    background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
}
.cmp-steps { display: flex; flex-direction: column; gap: var(--space-md); }
.cmp-step {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    display: flex; flex-direction: column; gap: var(--space-sm);
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
}
.cmp-step-head { display: flex; align-items: center; gap: var(--space-md); }
.cmp-step-no {
    font-weight: 700; color: var(--text-primary); font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: var(--space-sm);
}
.cmp-step-no::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent-gradient); box-shadow: 0 0 8px var(--accent-glow);
}
.cmp-step-wait { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 0.82rem; color: var(--text-secondary); }
.cmp-wait-input { width: 3.5rem; text-align: center; padding: 4px 6px; }
.cmp-step-remove { margin-left: auto; font-size: 1.05rem; padding: 2px 10px; }
.cmp-subject { font-weight: 500; }
.cmp-body { resize: vertical; font-family: inherit; line-height: 1.5; }

.cmp-editor-foot {
    display: flex; align-items: center; gap: var(--space-md);
    flex-wrap: wrap;
}
.cmp-editor-foot .btn-primary { margin-left: auto; }
.cmp-var-hint {
    font-size: 0.74rem; color: var(--text-muted); max-width: 40rem; line-height: 1.5;
    background: var(--bg-input); border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
    flex: 1 1 20rem;
}

/* A/B-Test-Toggle im Step-Kopf (Pille) */
.cmp-ab-toggle {
    background: var(--bg-input); border: 1px solid var(--glass-border); cursor: pointer;
    border-radius: var(--radius-full); padding: 3px 12px;
    color: var(--text-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
    transition: all var(--transition-fast);
}
.cmp-ab-toggle:hover { color: var(--text-secondary); }
.cmp-ab-toggle.is-on {
    color: #fff; border-color: transparent; background: var(--accent);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
}
.cmp-variant-label {
    font-size: 0.7rem; font-weight: 700; color: var(--text-accent);
    text-transform: uppercase; letter-spacing: 0.06em; margin-top: var(--space-xs);
}
.cmp-step-stats {
    display: flex; gap: var(--space-lg); flex-wrap: wrap;
    border-top: 1px solid var(--glass-border); padding-top: var(--space-sm); margin-top: var(--space-xs);
}
.cmp-step-stat { font-size: 0.76rem; color: var(--text-secondary); }

/* ── Absender-Pool (Rotation) im Detail-Kopf ───────────────────────────────── */
.cmp-senders-row {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    font-size: 0.85rem; align-self: flex-start;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-full); padding: 5px var(--space-md);
}
.cmp-senders-label { color: var(--text-muted); }
.cmp-senders-names { color: var(--text-primary); font-weight: 500; }
.cmp-senders-edit { font-size: 0.78rem; padding: 2px 8px; }
.cmp-senders-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 var(--space-sm); line-height: 1.5; }

/* Auto-Pause-Hinweis (Bounce-Rate) */
.cmp-pause-note { margin-top: var(--space-sm); font-size: 0.76rem; color: var(--warning); }
.cmp-pause-banner {
    font-size: 0.84rem; color: var(--warning); align-self: stretch;
    background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
}

/* ── Empfänger + Suppression: Tabelle ──────────────────────────────────────── */
.cmp-rec-toolbar { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-bottom: var(--space-md); }
.cmp-table-wrap {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cmp-table thead { background: rgba(15, 23, 42, 0.5); }
.cmp-table th {
    text-align: left; padding: var(--space-md) var(--space-lg); color: var(--text-muted);
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}
.cmp-table td {
    padding: var(--space-md) var(--space-lg); color: var(--text-secondary);
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
}
.cmp-table tbody tr { transition: background var(--transition-fast); }
.cmp-table tbody tr.cmp-row-clickable:hover { background: var(--bg-hover); }
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }
.cmp-empty { color: var(--text-muted); padding: var(--space-2xl) var(--space-lg); text-align: center; font-size: 0.9rem; }

/* Kontakt-Auswahl im Hinzufügen-Modal */
.cmp-add-modal { max-width: 34rem; width: 100%; }
.cmp-hit-list {
    margin-top: var(--space-sm); max-height: 320px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px;
}
.cmp-hit {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 8px var(--space-sm); border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-primary); font-size: 0.85rem; transition: background var(--transition-fast);
}
.cmp-hit:hover { background: var(--accent-soft); }
.cmp-hit.is-off { opacity: 0.45; cursor: default; }
.cmp-hit-mail { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; }

/* ── AI-Reply-Intents (P3): Badge-Farben je Absicht ────────────────────────── */
.cmp-badge.intent-interessiert { background: rgba(52, 211, 153, 0.15); color: var(--success); border-color: rgba(52, 211, 153, 0.28); }
.cmp-badge.intent-frage        { background: rgba(99, 102, 241, 0.16); color: var(--text-accent); border-color: rgba(99, 102, 241, 0.3); }
.cmp-badge.intent-ablehnung    { background: rgba(248, 113, 113, 0.13); color: var(--danger); border-color: rgba(248, 113, 113, 0.24); }
.cmp-badge.intent-abwesenheit  { background: rgba(251, 191, 36, 0.13); color: var(--warning); border-color: rgba(251, 191, 36, 0.24); }
.cmp-badge.intent-neutral      { background: rgba(148, 163, 184, 0.13); color: var(--text-secondary); }

/* Aufgeklappte AI-Antwort-Analyse */
.cmp-reply-detail td { background: rgba(6, 10, 20, 0.5); padding: 0 !important; }
.cmp-reply-panel {
    display: flex; flex-direction: column; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-left: 2px solid var(--accent);
}
.cmp-reply-summary, .cmp-reply-suggest { display: flex; flex-direction: column; gap: 4px; }
.cmp-reply-label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cmp-reply-draft { resize: vertical; font-family: inherit; line-height: 1.5; }
.cmp-reply-actions { display: flex; gap: var(--space-sm); }
.cmp-convert-btn { font-size: 0.8rem; }

.cmp-suppr-add { display: flex; gap: var(--space-sm); margin-bottom: 0; max-width: 32rem; }

/* Zustellbarkeits-Ampel (SPF/DKIM/DMARC) */
.cmp-deliv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.cmp-deliv-error {
    margin-top: var(--space-md); font-size: 0.82rem; color: var(--danger);
    background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
}
.cmp-deliv-result { margin-top: var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }
.cmp-deliv-domain { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; font-size: 0.9rem; }
.cmp-deliv-row { display: flex; align-items: flex-start; gap: var(--space-md); }
.cmp-deliv-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; }
.cmp-deliv-dot.dot-pass { background: var(--success); box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.cmp-deliv-dot.dot-warn { background: var(--warning); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.cmp-deliv-dot.dot-fail { background: var(--danger); box-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }
.cmp-deliv-name { font-weight: 700; color: var(--text-primary); min-width: 3.5rem; }
.cmp-deliv-detail { display: flex; flex-direction: column; gap: 3px; }
.cmp-deliv-hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.cmp-deliv-record { font-size: 0.72rem; color: var(--text-secondary); word-break: break-all; font-family: var(--font-mono); }

/* Deliverability-Monitoring (Multi-Domain-Dashboard, DELIV P1) */
.cmp-deliv-stack { display: flex; flex-direction: column; gap: var(--space-lg); }
.cmp-deliv-empty { margin-top: var(--space-md); font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.cmp-deliv-table { width: 100%; margin-top: var(--space-md); border-collapse: collapse; font-size: 0.85rem; }
.cmp-deliv-table th {
    text-align: left; font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px;
    border-bottom: 1px solid var(--border-subtle);
}
.cmp-deliv-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: middle; }
.cmp-deliv-table tbody tr:last-child td { border-bottom: none; }
/* Die Ampel-Dots sind inline-spans — in Tabellenzellen (kein Flex) brauchen
   sie inline-block, sonst kollabieren sie auf 0×0. */
.cmp-deliv-table .cmp-deliv-dot { display: inline-block; margin-top: 0; vertical-align: middle; }
.cmp-deliv-band { display: inline-block; width: 13px; height: 13px; border-radius: 50%; }
.cmp-deliv-band.band-green { background: var(--success); box-shadow: 0 0 9px rgba(52, 211, 153, 0.55); }
.cmp-deliv-band.band-amber { background: var(--warning); box-shadow: 0 0 9px rgba(251, 191, 36, 0.55); }
.cmp-deliv-band.band-red { background: var(--danger); box-shadow: 0 0 9px rgba(248, 113, 113, 0.55); }
.cmp-deliv-band.band-gray { background: var(--text-muted); opacity: 0.5; }
.cmp-deliv-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-deliv-score.score-green { color: var(--success); }
.cmp-deliv-score.score-amber { color: var(--warning); }
.cmp-deliv-score.score-red { color: var(--danger); }
.cmp-deliv-score.score-gray { color: var(--text-muted); }
.cmp-deliv-bl { font-size: 0.78rem; }
.cmp-deliv-bl.bl-ok { color: var(--success); }
.cmp-deliv-bl.bl-bad { color: var(--danger); font-family: var(--font-mono); font-size: 0.72rem; word-break: break-all; }
.cmp-deliv-bl.bl-gray { color: var(--text-muted); }
.cmp-deliv-cell-domain { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }
.cmp-deliv-cell-when { color: var(--text-muted); white-space: nowrap; font-size: 0.78rem; }

/* CSV-Import-Dialog */
.cmp-csv-modal { max-width: 36rem; width: 100%; }
.cmp-csv-file { display: block; margin-bottom: var(--space-sm); color: var(--text-secondary); font-size: 0.85rem; }
.cmp-csv-text { resize: vertical; font-family: var(--font-mono); font-size: 0.8rem; }
.cmp-csv-preview {
    display: flex; flex-direction: column; gap: 3px; margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md); background: var(--bg-input);
    border: 1px solid var(--glass-border-subtle); border-radius: var(--radius-sm);
}
.cmp-csv-count { font-weight: 600; color: var(--text-primary); font-size: 0.85rem; }

/* UWG-Bestätigungsdialog */
.cmp-uwg-check {
    display: flex; align-items: flex-start; gap: var(--space-sm);
    font-size: 0.85rem; color: var(--text-secondary); cursor: pointer;
    padding: var(--space-sm) 0; line-height: 1.45;
}
.cmp-uwg-check input { margin-top: 3px; flex: 0 0 auto; accent-color: var(--accent); }

/* Aufwärm-Schutz-Badge (Ramp-up sichtbar machen) */
.cmp-ramp-badge {
    display: flex; align-items: flex-start; gap: var(--space-md);
    padding: var(--space-md); margin-bottom: var(--space-lg);
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.25); border-radius: var(--radius-md);
}
.cmp-ramp-icon { font-size: 1.2rem; line-height: 1.3; flex: 0 0 auto; }
.cmp-ramp-text { display: flex; flex-direction: column; gap: 3px; }
.cmp-ramp-title { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.cmp-ramp-detail { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }

/* Live-Vorschau im Sequenz-Editor (Vorschau == Versand) */
.cmp-preview-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.cmp-preview-toggle.is-on { color: var(--text-accent); background: var(--bg-hover); }
.cmp-preview-note { font-size: 0.8rem; color: var(--text-muted); }
.cmp-preview {
    margin-top: var(--space-sm); padding: var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-hover); border-radius: var(--radius-md);
    box-shadow: var(--shadow-inner-glow);
}
.cmp-preview-variant {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-accent); margin-bottom: 4px;
}
.cmp-preview-variant:not(:first-child) { margin-top: var(--space-md); }
.cmp-preview-subject {
    font-weight: 700; color: var(--text-primary); font-size: 0.95rem;
    padding-bottom: var(--space-sm); margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border-subtle);
}
.cmp-preview-body {
    margin: 0; font-family: inherit; font-size: 0.88rem; color: var(--text-secondary);
    line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

.cmp-preview-reroll { font-size: 0.82rem; }

/* AI-Sequenz-Entwurf */
.cmp-ai-btn { border-color: var(--glass-border-hover); color: var(--text-accent); }
.cmp-ai-modal { max-width: 34rem; width: 100%; }
.cmp-ai-brief { resize: vertical; min-height: 5rem; line-height: 1.5; }
.cmp-ai-note {
    display: block; margin-top: var(--space-xs); font-size: 0.8rem;
    color: var(--text-muted); line-height: 1.45;
}

/* ═══ Kampagnen-Wizard / Main-Box (Redesign) ═══════════════════════════════ */
/* Main-Box: das Detail ist EINE große Glas-Karte. */
.cmp-detail.glass-panel { padding: var(--space-lg) var(--space-xl) var(--space-xl); gap: var(--space-md); }
.cmp-detail-name { margin: 0; }
.cmp-detail-title-row .spacer,
.cmp-wizard-footer .spacer,
.cmp-editor-foot .spacer { flex: 1 1 auto; }

/* Absender-Chip im Kopf („von wem geht das raus") */
.cmp-sender-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.12); border: 1px solid var(--glass-border-hover);
    color: var(--text-accent); font-size: 0.8rem; font-weight: 600; max-width: 22rem;
}
.cmp-sender-chip.is-empty { color: var(--danger); background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); }
.cmp-sender-chip-ic { display: inline-flex; }
.cmp-sender-chip-ic svg { width: 13px; height: 13px; }
.cmp-sender-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Stepper + Fortschritt */
.cmp-stepper { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-md); }
.cmp-step-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: var(--radius-full);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition-fast);
}
.cmp-step-pill:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.cmp-step-pill.is-active { color: #fff; background: var(--accent-gradient); border-color: transparent; box-shadow: var(--shadow-sm); }
.cmp-step-pill.is-done:not(.is-active) { color: var(--success); border-color: rgba(52,211,153,0.4); }
.cmp-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; font-size: 0.75rem;
    background: rgba(255,255,255,0.12);
}
.cmp-step-pill.is-active .cmp-step-num { background: rgba(255,255,255,0.22); }
.cmp-step-check { display: inline-flex; }
.cmp-step-check svg { width: 16px; height: 16px; }
.cmp-progress { height: 3px; border-radius: 2px; background: var(--bg-input); margin-top: var(--space-sm); overflow: hidden; }
.cmp-progress-fill { height: 100%; background: var(--accent-gradient); transition: width var(--transition-normal); }

/* Wizard-Body + Fuß. Die Main-Box hat eine FESTE Bühnenhöhe — sie wächst und
   springt nicht mit dem Schrittinhalt; stattdessen scrollt der Body innen und
   der Fuß klebt am Boxboden. */
.cmp-detail.glass-panel { height: calc(100vh - 7.5rem); overflow: hidden; }
.cmp-wizard-body {
    margin-top: var(--space-lg); flex: 1 1 auto; min-height: 0;
    overflow-y: auto; padding-right: 4px;
}
.cmp-wizard-footer {
    display: flex; align-items: center; gap: var(--space-md);
    margin-top: var(--space-md); padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
    flex: 0 0 auto;
}

/* Einzel-Schritt-Panes */
.cmp-step-pane { display: flex; flex-direction: column; gap: var(--space-md); max-width: 46rem; }
.cmp-step-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.cmp-step-sub { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.cmp-name-input { max-width: 30rem; font-size: 1.05rem; }
.cmp-sender-card { padding: var(--space-md); background: var(--bg-input); border: 1px solid var(--glass-border); border-radius: var(--radius-md); }

/* „Das System macht den Rest" */
.cmp-smart-info {
    display: flex; gap: var(--space-md); align-items: flex-start;
    padding: var(--space-md); border-radius: var(--radius-md);
    background: rgba(52,211,153,0.06); border: 1px solid rgba(52,211,153,0.22);
}
.cmp-smart-ic { color: var(--success); flex: 0 0 auto; }
.cmp-smart-ic svg { width: 20px; height: 20px; }
.cmp-smart-title { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.cmp-smart-text { margin: 3px 0 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* Variablen-Chips (statt grauem Fließtext) */
.cmp-var-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--space-md); }
.cmp-var-chips-label { font-size: 0.78rem; color: var(--text-muted); margin-right: 2px; }
.cmp-var-chip {
    font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-accent);
    background: rgba(99,102,241,0.1); border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-sm); padding: 2px 8px; cursor: pointer; transition: var(--transition-fast);
}
.cmp-var-chip:hover { background: rgba(99,102,241,0.2); color: #fff; }
.cmp-var-chips-hint { font-size: 0.72rem; color: var(--text-muted); }

/* Mail-Blatt: Editor-Felder blickdicht (lesbar über jedem Hintergrund) */
.cmp-subject, .cmp-body { background: var(--glass-bg); }
.cmp-body { min-height: 12rem; }

/* Automations-Discovery im Start-Schritt */
.cmp-auto-hint { padding: var(--space-md); border-radius: var(--radius-md); background: rgba(99,102,241,0.06); border: 1px solid var(--glass-border-hover); }
.cmp-auto-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.cmp-auto-ic { color: var(--text-accent); display: inline-flex; }
.cmp-auto-ic svg { width: 16px; height: 16px; }
.cmp-auto-text { margin: 6px 0 var(--space-sm); font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.cmp-auto-triggers { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-auto-chip { font-size: 0.72rem; font-weight: 600; color: var(--text-accent); background: rgba(99,102,241,0.14); border-radius: var(--radius-full); padding: 2px 10px; }

/* Wizard-Layout-Feinschliff: zwei Spalten (Nachricht) + Zentrierung */
.cmp-step-cols { display: flex; gap: var(--space-lg); align-items: flex-start; }
.cmp-step-edit { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.cmp-step-cols .cmp-preview { flex: 1 1 0; min-width: 0; margin-top: 0; align-self: stretch; position: sticky; top: var(--space-md); }
@media (max-width: 900px) { .cmp-step-cols { flex-direction: column; } .cmp-step-cols .cmp-preview { position: static; } }
/* Name & Start mittig; Empfänger/Nachricht kompakt + zentriert */
.cmp-step-pane { margin-inline: auto; }
.cmp-wizard-narrow { max-width: 56rem; margin: 0 auto; }

/* ═══ Wizard-Schritt „Einstellungen" ═══════════════════════════════════════ */
.cmp-set-pane { max-width: 46rem; }
.cmp-set-card {
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding: var(--space-md); border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
}
.cmp-set-head { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.cmp-set-slider-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.cmp-set-range { flex: 1 1 8rem; min-width: 7rem; accent-color: var(--text-accent); cursor: pointer; }
.cmp-set-value {
    font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums;
    white-space: nowrap; min-width: 6.5rem; text-align: right;
}
.cmp-set-mini { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cmp-set-hint { margin: 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.cmp-set-toggle { display: flex; gap: var(--space-sm); align-items: flex-start; cursor: pointer; }
.cmp-set-toggle input { margin-top: 3px; accent-color: var(--text-accent); }
.cmp-set-toggle-body { display: flex; flex-direction: column; gap: 2px; }
.cmp-set-toggle-title { font-weight: 600; color: var(--text-primary); font-size: 0.85rem; }
.cmp-set-deliv { border-top: 1px solid var(--glass-border); padding-top: var(--space-sm); display: flex; flex-direction: column; gap: 6px; }
.cmp-set-deliv-row { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; font-size: 0.82rem; }
.cmp-set-deliv-row .cmp-deliv-band { display: inline-block; }
.cmp-set-deliv-check { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 0.78rem; }
.cmp-set-deliv-check .cmp-deliv-dot { display: inline-block; margin-top: 0; width: 9px; height: 9px; }
.cmp-set-guards {
    display: flex; flex-direction: column; gap: 8px;
    padding: var(--space-md); border-radius: var(--radius-md);
    background: rgba(52,211,153,0.06); border: 1px solid rgba(52,211,153,0.22);
}
.cmp-set-guards-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.cmp-set-guard { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
.cmp-set-guard .cmp-check-ic { flex: 0 0 auto; }

/* ═══ Startseite-Redesign (Toolbar + dichte Liste) ═══════════════════════════ */
.cmp-page { gap: var(--space-md); }
.cmp-list-view { display: flex; flex-direction: column; gap: var(--space-sm); }
.cmp-pagetabs { margin-bottom: 0; }

/* Werkzeug-Zeile */
.cmp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.cmp-toolbar .spacer { flex: 1 1 auto; }
.cmp-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-full); min-width: 14rem; }
.cmp-search:focus-within { border-color: var(--glass-border-hover); }
.cmp-search-ic { display: inline-flex; color: var(--text-muted); }
.cmp-search-ic svg { width: 14px; height: 14px; }
.cmp-search-input { border: none; background: transparent; color: var(--text-primary); font-size: 0.85rem; padding: 7px 0; width: 100%; outline: none; }
.cmp-select { padding: 7px 12px; font-size: 0.82rem; color: var(--text-secondary); background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-full); cursor: pointer; }
.cmp-select:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.cmp-view-toggle { display: inline-flex; background: var(--bg-input); border: 1px solid var(--glass-border); border-radius: var(--radius-full); overflow: hidden; }
.cmp-view-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: var(--transition-fast); }
.cmp-view-btn:hover { color: var(--text-primary); }
.cmp-view-btn.is-on { color: #fff; background: var(--accent-gradient); }
.cmp-view-btn svg { width: 16px; height: 16px; }

/* Dichteres Grid + kompaktere Karte */
.cmp-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); }
.cmp-card { padding: var(--space-md); gap: var(--space-sm); }
.cmp-card-meta { font-size: 0.78rem; }
.cmp-funnel { grid-template-columns: repeat(3, 1fr); }

/* Kampagnen-Tabelle */
.cmp-camp-table th:nth-child(n+5), .cmp-camp-table td:nth-child(n+5) { text-align: right; }
.cmp-camp-table td:first-child { font-weight: 600; color: var(--text-primary); }

/* Karten-Aktionsmenü (⋮) + Inline-Umbenennung */
.cmp-card { overflow: visible; }
.cmp-card-head { display: flex; align-items: center; gap: var(--space-sm); }
.cmp-card-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-rename-input { flex: 1 1 auto; min-width: 0; font-size: 0.95rem; padding: 4px 8px; }
.cmp-card-menu { position: relative; flex: 0 0 auto; }
.cmp-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition-fast); }
.cmp-menu-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.cmp-menu-btn svg { width: 16px; height: 16px; }
.cmp-menu-dropdown { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 11rem;
    display: flex; flex-direction: column; padding: 4px; background: var(--glass-bg);
    border: 1px solid var(--glass-border-hover); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.cmp-menu-item { text-align: left; padding: 7px 10px; font-size: 0.85rem; color: var(--text-secondary);
    background: transparent; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.cmp-menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.cmp-menu-item.cmp-danger { color: var(--danger); }
.cmp-menu-item.cmp-danger:hover { background: rgba(248,113,113,0.12); }

/* Filter-Zeile in der Empfänger-Auswahl */
.cmp-modal-filters { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }
.cmp-tag-input { flex: 1 1 auto; min-width: 0; }

/* ── Gespeicherte Kontaktlisten („Listen"-Tab) ───────────────────────────── */
.cmp-lists-toolbar { align-items: center; }
.cmp-lists-hint { font-size: 0.82rem; color: var(--text-muted); max-width: 46ch; line-height: 1.4; }

/* Art-Badge: smart = Akzent, statisch = neutral. */
.cmp-badge.kind-smart  { background: rgba(99, 102, 241, 0.14); color: var(--text-accent);
    border-color: rgba(99, 102, 241, 0.28); display: inline-flex; align-items: center; gap: 4px; }
.cmp-badge.kind-static { background: rgba(148, 163, 184, 0.13); color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.24); }
.cmp-kind-ic { display: inline-flex; width: 12px; height: 12px; }
.cmp-kind-ic svg { width: 100%; height: 100%; }

.cmp-list-card { cursor: pointer; }
.cmp-list-count { display: flex; align-items: center; gap: 6px; font-size: 0.85rem;
    color: var(--text-secondary); font-weight: 500; }
.cmp-list-count-ic { display: inline-flex; width: 15px; height: 15px; color: var(--text-muted); }
.cmp-list-count-ic svg { width: 100%; height: 100%; }

/* Erstellen-/Detail-Modal etwas breiter für Tabelle + Picker. */
.cmp-list-modal { width: min(640px, 94vw); }
.cmp-list-detail { width: min(760px, 94vw); }

/* Art-Umschalter (statisch | smart). */
.cmp-kind-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm);
    margin-top: var(--space-sm); }
.cmp-kind-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 10px 12px; text-align: left; border-radius: var(--radius-md);
    border: 1px solid var(--glass-border); background: var(--bg-input); cursor: pointer;
    transition: border-color 0.15s, background 0.15s; }
.cmp-kind-btn:hover { border-color: var(--glass-border-hover); }
.cmp-kind-btn.is-on { border-color: rgba(99, 102, 241, 0.55); background: var(--accent-soft); }
.cmp-kind-title { display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
    font-size: 0.9rem; color: var(--text-primary); }
.cmp-kind-sub { font-size: 0.76rem; color: var(--text-muted); }

.cmp-smart-filters { display: flex; flex-direction: column; gap: var(--space-sm);
    margin-top: var(--space-sm); }
.cmp-smart-preview { font-size: 0.82rem; color: var(--text-accent); font-weight: 500; }

.cmp-picker { margin-top: var(--space-sm); }
.cmp-filter-summary { display: flex; align-items: center; gap: 6px; font-size: 0.82rem;
    color: var(--text-secondary); padding: 8px 10px; border-radius: var(--radius-md);
    background: var(--accent-soft); margin-bottom: var(--space-sm); }
.cmp-detail-tools { margin-bottom: var(--space-sm); }
.cmp-add-inline { padding: var(--space-sm); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); margin-bottom: var(--space-sm); }
.cmp-detail-table { max-height: 46vh; overflow: auto; }

/* Auswahl-Zeile im „Aus Liste"-Modal. */
.cmp-list-row { display: flex; align-items: center; gap: var(--space-sm); width: 100%;
    padding: 10px 12px; text-align: left; border: none; background: transparent;
    border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s; }
.cmp-list-row:hover { background: var(--accent-soft); }
.cmp-list-row:disabled { opacity: 0.5; cursor: default; }
.cmp-list-row-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.cmp-list-row-count { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); }

/* Art-Anzeige im Bearbeiten-Modal (Art ist nach Anlegen fix). */
.cmp-edit-kind { display: flex; align-items: center; gap: 8px; margin-top: var(--space-sm);
    font-size: 0.85rem; color: var(--text-secondary); }
.cmp-edit-kind-note { color: var(--text-muted); font-size: 0.78rem; }

/* ── Design-Politur: KPI-Zeile · Funnel-Flow · Ergebnisse · Karten-Progress ── */

/* Überblicks-Zeile der Startseite (Dashboard-Stil). */
.cmp-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-sm); margin-bottom: var(--space-md);
}
.cmp-kpi {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
    background: var(--bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cmp-kpi:hover { border-color: var(--glass-border-hover); transform: translateY(-1px); }
.cmp-kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1.15; }
.cmp-kpi-label { font-size: 0.72rem; color: var(--text-muted); }
.cmp-kpi.tone-good .cmp-kpi-value { color: var(--success); }
.cmp-kpi.tone-accent .cmp-kpi-value { color: var(--text-accent); }

/* Funnel-Flow im Kampagnen-Detail: Stufen mit Pfeilen + Quote. */
.cmp-flow {
    display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap;
    margin-top: var(--space-md);
}
.cmp-flow-stage {
    flex: 1 1 120px; min-width: 110px; display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px; background: var(--bg-card);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    transition: border-color 0.15s, transform 0.15s;
}
.cmp-flow-stage:hover { border-color: var(--glass-border-hover); transform: translateY(-1px); }
.cmp-flow-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1.15; }
.cmp-flow-label { font-size: 0.74rem; color: var(--text-secondary); font-weight: 500; }
.cmp-flow-rate  { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cmp-flow-stage.tone-good   { border-color: rgba(52, 211, 153, 0.3); }
.cmp-flow-stage.tone-good .cmp-flow-value { color: var(--success); }
.cmp-flow-stage.tone-good .cmp-flow-rate  { color: var(--success); }
.cmp-flow-stage.tone-accent .cmp-flow-value { color: var(--text-accent); }
.cmp-flow-arrow {
    align-self: center; display: inline-flex; width: 16px; height: 16px;
    color: var(--text-muted); opacity: 0.6; flex: 0 0 auto;
}
.cmp-flow-arrow svg { width: 100%; height: 100%; }

/* Ergebnisse (grün, das Ziel) + Hygiene-Chips (dezent) unter dem Funnel. */
.cmp-outcome-row {
    display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
    margin-top: var(--space-md);
}
.cmp-outcome-row .spacer { flex: 1 1 auto; }
.cmp-outcomes { display: flex; align-items: center; gap: var(--space-sm); }
.cmp-outcome-title { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.cmp-outcome {
    display: flex; align-items: baseline; gap: 8px; padding: 10px 16px;
    background: var(--bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}
.cmp-outcome.is-won { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
.cmp-outcome-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.cmp-outcome.is-won .cmp-outcome-value { color: var(--success); }
.cmp-outcome-label { font-size: 0.78rem; color: var(--text-secondary); }
.cmp-hygiene { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmp-hyg-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
    font-size: 0.74rem; color: var(--text-muted);
    border: 1px solid var(--glass-border); border-radius: 999px;
}
.cmp-hyg-value { font-weight: 700; color: var(--text-secondary); }
.cmp-hyg-chip.tone-bad { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.cmp-hyg-chip.tone-bad .cmp-hyg-value { color: var(--danger); }

/* Karten: Badge in der Meta-Zeile + Versand-Fortschrittsbalken. */
.cmp-card-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-card-meta-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-cardbar { display: flex; align-items: center; gap: 10px; }
.cmp-cardbar-track {
    flex: 1 1 auto; height: 5px; border-radius: 999px;
    background: var(--bg-input); overflow: hidden;
}
.cmp-cardbar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--text-accent), var(--success));
    transition: width 0.3s ease;
}
.cmp-cardbar-txt { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Smart-Listen-Karte: Filter-Zusammenfassung direkt sichtbar. */
.cmp-list-filter {
    display: flex; align-items: center; gap: 6px; font-size: 0.76rem;
    color: var(--text-accent); min-width: 0;
}
.cmp-list-filter-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Quoten-Spalte der Tabellenansicht. */
.cmp-quote-cell { font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* ═══ Verträge / Selly Sign (Modul esign) ═══════════════════════════════════ */

.es-topbar { display: flex; align-items: center; gap: var(--space-md); }
.es-page { display: flex; flex-direction: column; gap: var(--space-md); }
.es-sub { margin: 4px 0 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; max-width: 44rem; }

/* Liste */
.es-list { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg) var(--space-xl); }
.es-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.es-empty { padding: var(--space-xl) 0; max-width: 34rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }
.es-empty-title { font-weight: 700; color: var(--text-primary); font-size: 1.05rem; margin-bottom: 6px; }
.es-legal-hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; margin: 6px 0 0; }
.es-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.es-table th {
    text-align: left; font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px;
    border-bottom: 1px solid var(--border-subtle);
}
.es-table td { padding: 11px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.es-row { cursor: pointer; transition: var(--transition-fast); }
.es-row:hover td { background: rgba(255, 255, 255, 0.03); color: var(--text-primary); }
.es-cell-title { font-weight: 600; color: var(--text-primary); }
.es-cell-num { font-variant-numeric: tabular-nums; }
.es-cell-when { color: var(--text-muted); white-space: nowrap; }

/* Status-Badges (Dokument + Signer) */
.es-badge {
    display: inline-flex; align-items: center; padding: 2px 10px;
    border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700;
    background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--glass-border);
}
.es-badge.st-draft { color: var(--text-secondary); }
.es-badge.st-sent, .es-badge.sg-pending, .es-badge.sg-viewed { color: var(--warning); border-color: rgba(251,191,36,0.35); }
.es-badge.st-completed, .es-badge.sg-signed { color: var(--success); border-color: rgba(52,211,153,0.35); }
.es-badge.st-declined, .es-badge.st-voided, .es-badge.st-expired, .es-badge.sg-declined { color: var(--danger); border-color: rgba(248,113,113,0.35); }

/* Sende-Modal */
.es-send-modal { max-width: 34rem; width: 100%; }
.es-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: var(--space-sm); }
.es-file { color: var(--text-secondary); font-size: 0.85rem; }
.es-file-chip { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-accent); }
.es-message { resize: vertical; font-family: inherit; }
.es-signer-row { display: flex; gap: var(--space-sm); align-items: center; }
.es-signer-row .input-field { flex: 1 1 0; min-width: 0; }
.es-signer-rm { padding: 2px 10px; font-size: 1rem; }
.es-signer-add { align-self: flex-start; font-size: 0.8rem; }
.es-expiry { max-width: 12rem; }
.es-error {
    font-size: 0.82rem; color: var(--danger);
    background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
}

.es-toggle { display: flex; gap: var(--space-sm); align-items: flex-start; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
.es-toggle input { margin-top: 3px; accent-color: var(--text-accent); }
.es-template-row { display: flex; gap: var(--space-sm); align-items: center; }
.es-template-sel { flex: 1 1 auto; }
.es-seq-badge { color: var(--text-accent); border-color: var(--glass-border-hover); }
.es-signer-actions { margin-left: auto; display: flex; gap: var(--space-sm); }
.es-signer-actions .es-copy { margin-left: 0; }

/* Detail */
.es-detail { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg) var(--space-xl); }
.es-back { align-self: flex-start; }
.es-detail-head { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.es-detail-head .spacer { flex: 1 1 auto; }
.es-detail-title { margin: 0; }
.es-danger { color: var(--danger); }
.es-meta { display: flex; flex-wrap: wrap; gap: 6px var(--space-lg); font-size: 0.82rem; color: var(--text-muted); }
.es-hashes { display: flex; flex-direction: column; gap: 4px; }
.es-hash-row { display: flex; align-items: baseline; gap: var(--space-sm); }
.es-hash-label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.es-hash { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary); word-break: break-all; }
.es-section-title { font-weight: 700; color: var(--text-primary); font-size: 0.95rem; margin-top: var(--space-sm); }
.es-signers { display: flex; flex-direction: column; gap: var(--space-sm); }
.es-signer-card {
    display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input); border: 1px solid var(--glass-border); border-radius: var(--radius-md);
}
.es-signer-main { display: flex; flex-direction: column; min-width: 14rem; }
.es-signer-name { font-weight: 600; color: var(--text-primary); }
.es-signer-mail { font-size: 0.8rem; color: var(--text-muted); }
.es-signer-proof { display: flex; gap: var(--space-md); font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.es-signer-ip { font-family: var(--font-mono); font-size: 0.72rem; }
.es-signer-decline { color: var(--danger); }
.es-copy { margin-left: auto; font-size: 0.78rem; }
.es-events { display: flex; flex-direction: column; gap: 4px; }
.es-event { display: flex; gap: var(--space-md); font-size: 0.8rem; color: var(--text-secondary); flex-wrap: wrap; }
.es-event-when { color: var(--text-muted); white-space: nowrap; min-width: 10rem; }
.es-event-label { font-weight: 600; color: var(--text-primary); min-width: 8rem; }
.es-event-ip { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }

/* ═══ Öffentliche Signier-Zeremonie /sign/:token ════════════════════════════ */
/* Eigener Vollbild-Scrollcontainer: die App-Shell sperrt den body-Scroll
   (html/body overflow-y hidden in _reset.css) — die Zeremonie MUSS aber
   scrollen (Handy + Desktop), sonst ist „Verbindlich unterschreiben"
   unterhalb des PDFs unerreichbar. */
.sp-page {
    position: fixed; inset: 0; z-index: 10;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    display: flex; justify-content: center; align-items: flex-start;
    padding: var(--space-lg);
    background: var(--bg-base, #0b0e1a);
}
.sp-shell { width: 100%; max-width: 52rem; display: flex; flex-direction: column; gap: var(--space-md); }
.sp-brand { font-weight: 800; letter-spacing: 0.02em; color: var(--text-accent); font-size: 0.9rem; }
.sp-card {
    display: flex; flex-direction: column; gap: var(--space-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    box-shadow: var(--shadow-md);
}
.sp-title { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.sp-muted { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.sp-message { margin: var(--space-sm) 0 0; padding: var(--space-sm) var(--space-md); border-left: 3px solid var(--text-accent); background: rgba(99,102,241,0.08); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.88rem; }
.sp-note { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); font-size: 0.88rem; line-height: 1.5; }
.sp-note.is-ok { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }
.sp-note.is-bad { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }
.sp-doc { display: flex; flex-direction: column; gap: var(--space-sm); }
.sp-frame { width: 100%; height: 420px; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: #fff; }
.sp-doc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.sp-hash { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.sp-sign { display: flex; flex-direction: column; gap: var(--space-sm); border-top: 1px solid var(--glass-border); padding-top: var(--space-md); }
.sp-sign-title { font-weight: 700; color: var(--text-primary); }
/* Click-to-Sign: Signatur-Vorschau (Name + heutiges Datum, automatisch) */
.sp-click-preview {
    display: flex; align-items: baseline; gap: var(--space-lg); flex-wrap: wrap;
    padding: var(--space-md); border: 1px dashed var(--glass-border-hover);
    border-radius: var(--radius-md); background: rgba(255,255,255,0.03);
}
.sp-click-name { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 1.9rem; color: var(--text-primary); }
.sp-click-date { font-size: 0.85rem; color: var(--text-muted); }
.sp-confirm { max-width: 30rem; width: 100%; }
.sp-confirm-sig {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md);
    padding: var(--space-md); border: 1px dashed var(--glass-border-hover);
    border-radius: var(--radius-md); background: rgba(255,255,255,0.03);
}
.sp-confirm-name { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 1.6rem; color: var(--text-primary); }
.sp-confirm-date { font-size: 0.82rem; color: var(--text-muted); }
.sp-consent { display: flex; gap: var(--space-sm); align-items: flex-start; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; cursor: pointer; }
.sp-consent input { margin-top: 3px; accent-color: var(--text-accent); }
.sp-fineprint { margin: 0; font-size: 0.72rem; color: var(--text-muted); }
.sp-error { font-size: 0.82rem; color: var(--danger); background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.25); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); }
.sp-actions { display: flex; align-items: center; gap: var(--space-md); }
.sp-actions .spacer { flex: 1 1 auto; }
.sp-sign-btn { font-weight: 700; }
.sp-decline { display: flex; flex-direction: column; gap: var(--space-sm); }

/* ── P7: Vollbild-Ansicht der Zeremonie ─────────────────────────────────────
   Derselbe Viewer-Container, nur als Fixed-Overlay (Re-Render passt die
   Seitenbreite an). Liegt UNTER dem Bestätigungs-Popup (backdrop z 200).
   position:relative macht den Viewer zum offsetParent der Seiten-Canvases —
   Geometrie und Cursor-Anteile rechnen dadurch sauber in Content-Koordinaten. */
.sp-pdfv { position: relative; }
.sp-fs-head { display: none; }
.sp-doc.is-full {
    position: fixed; inset: 0; z-index: 150;
    background: var(--bg-base, #0b0e1a);
    padding: var(--space-sm) var(--space-md);
}
.sp-doc.is-full .sp-fs-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-md);
}
.sp-fs-title {
    font-weight: 700; color: var(--text-primary); font-size: 0.95rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-doc.is-full .sp-frame { flex: 1 1 auto; height: auto; min-height: 0; }
.sp-doc-foot-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.sp-fullbtn { display: inline-flex; align-items: center; gap: 6px; }
.sp-fullbtn-ic { display: inline-flex; }
.sp-fullbtn-ic svg { width: 14px; height: 14px; }

@media (max-width: 700px) {
    .sp-page { padding: var(--space-sm); }
    .sp-card { padding: var(--space-md); }
    .sp-frame { height: 300px; }
    /* Handy: Buttons stapeln statt in einer (zu breiten) Zeile — der lange
       „Dokument bestätigen & unterschreiben"-Button zwang sonst zum
       Seitwärts-Wischen. Unterschreiben oben in voller Breite. */
    .sp-actions { flex-direction: column-reverse; align-items: stretch; gap: var(--space-sm); }
    .sp-actions .spacer { display: none; }
    .sp-actions .btn { width: 100%; justify-content: center; }
    .sp-sign-btn { white-space: normal; }
}

/* ═══ Verträge-Panel im Kunden-/Firmenprofil (P3) ═══════════════════════════
   Das Panel sitzt im Editor-Slot (`.cp-right-editor`, max-height 640px) und
   scrollt intern; der Feed darunter bleibt sichtbar. ⛶ (`is-full`) nimmt
   zusätzlich den Feed-Bereich der Spalte ein — Muster wie der Datei-Explorer
   (definite Spaltenhöhe, Body versteckt), NICHT den ganzen Bildschirm. */
.ep-wrap {
    /* FESTE Größe = Notizfeld (gemessen 264px) — die Box atmet nie mit dem
       Inhalt; Kopf/Fußzeile stehen fix, nur .ep-body scrollt intern. */
    height: 264px; flex-shrink: 0;
    position: relative;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 14px 12px;
    min-height: 0; overflow: hidden;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

/* Kompakt & zentriert wie die anderen Editor-Felder (Muster .cp-mail-body):
   Kopf/Fußleiste bleiben Aktionsleisten in voller Breite, der Inhalt läuft
   in einer zentrierten Spalte. */
.ep-center {
    width: 100%; max-width: 540px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 8px;
}
.ep-foot-inner {
    width: 100%; max-width: 540px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-sm);
}
.ep-foot-inner .spacer { display: none; }

/* Drag & Drop: Overlay-Hinweis über dem ganzen Panel (Events fängt .ep-wrap) */
.ep-dropzone-overlay {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.10); backdrop-filter: blur(2px);
    border: 2px dashed rgba(99, 102, 241, 0.55); border-radius: var(--radius-lg);
    color: var(--text-accent); font-size: 0.88rem; font-weight: 600;
    pointer-events: none; text-align: center; padding: var(--space-md);
}
/* Klick-/Drop-Fläche im „Vom Computer"-Schritt */
.ep-dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 18px var(--space-md);
    border: 1.5px dashed var(--glass-border-hover); border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary); font-size: 0.82rem;
    cursor: pointer; transition: var(--transition-fast); text-align: center;
}
.ep-dropzone:hover { border-color: var(--text-accent); color: var(--text-primary); background: rgba(99,102,241,0.06); }
.ep-dz-ic { display: inline-flex; color: var(--text-muted); }
.ep-dz-ic svg { width: 20px; height: 20px; }
.ep-list, .ep-compose {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.ep-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    padding-right: 2px;
}
.ep-foot {
    flex-shrink: 0; display: flex; align-items: center; gap: var(--space-sm);
    border-top: 1px solid var(--glass-border); padding-top: 8px;
}
.ep-foot .spacer { flex: 1 1 auto; }
.ep-foot-err {
    flex: 1 1 auto; min-width: 0; color: var(--danger); font-size: 0.78rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-foot-err + .spacer { flex: 0 1 auto; }

/* Stepper-Pills im Kopf — sie SIND die Checkliste (✓ sobald erfüllt) */
.ep-steps { display: flex; gap: 6px; }
.ep-step {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px 3px 4px; font-size: 0.75rem; font-weight: 600;
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-full);
    cursor: pointer; transition: var(--transition-fast); white-space: nowrap;
}
.ep-step:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.ep-step.is-active {
    background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-accent);
}
.ep-step-n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.07); font-size: 0.68rem;
}
.ep-step.is-done .ep-step-n { background: rgba(52, 211, 153, 0.18); color: var(--success); }
.ep-close { font-size: 1.05rem; padding: 2px 10px; }
/* Editor-Slot im Verträge-Modus: transform/will-change des Collapse-Effekts
   würden für das position:fixed-Vorschau-Popup einen Containing Block
   erzeugen (Popup klebt dann in der Box statt am Viewport) — hier abschalten;
   der Slot kollabiert in diesem Modus ohnehin nie. */
.cp-right-editor:has(.ep-wrap) { transform: none; will-change: auto; }
.cp-right:has(.ep-wrap.is-full) { height: calc(100vh - 120px); }
.cp-right:has(.ep-wrap.is-full) .cp-right-body { display: none; }
.cp-right:has(.ep-wrap.is-full) .cp-right-editor {
    flex: 1 1 auto; min-height: 0; max-height: none;
}
.ep-wrap.is-full { height: auto; flex: 1 1 auto; min-height: 0; }
.ep-head-actions { display: flex; align-items: center; gap: var(--space-sm); }
.ep-fullbtn { padding: 4px 8px; }
.ep-fullbtn-ic { display: inline-flex; }
.ep-fullbtn-ic svg { width: 15px; height: 15px; }
.ep-head { flex-shrink: 0; display: flex; align-items: center; gap: var(--space-md); }
.ep-head .ep-head-actions { margin-left: auto; }
/* Listen-Kopf (Titel · „Vertrag senden" · ⛶ · ×) bündig mit der zentrierten
   Kartenspalte — nicht an den Panel-Außenkanten kleben. */
.ep-list > .ep-head { width: 100%; max-width: 540px; margin: 0 auto; }
/* Wizard-Kopf ohne Titel: Pills exakt mittig, ⛶/× rechts (absolut, damit
   die Zentrierung nicht von der Breite der Aktionen abhängt). */
.ep-head-steps { position: relative; justify-content: center; }
.ep-head-steps .ep-head-actions { position: absolute; right: 0; margin-left: 0; }
.ep-title { font-weight: 700; color: var(--text-primary); font-size: 0.92rem; white-space: nowrap; }
.ep-empty { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; max-width: 34rem; }
.ep-doc {
    flex-shrink: 0; display: flex; flex-direction: column; gap: 6px;
    padding: 8px 10px; background: var(--bg-input);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
}
/* EIN Spalten-Raster für Kopf- UND Signer-Zeilen (Name | Status | Datum |
   Aktion) — feste Spaltenbreiten, damit Badges, Daten und Buttons über alle
   Karten hinweg bündig untereinander stehen (Symmetrie-Vorgabe). */
.ep-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px 186px 26px;
    align-items: center; gap: var(--space-sm);
}
.ep-row-main { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.ep-row > .es-badge { justify-self: center; }
.ep-row-when {
    justify-self: end; text-align: right; white-space: nowrap;
    font-size: 0.75rem; color: var(--text-muted);
}
.ep-row-actions {
    justify-self: end; display: inline-flex; align-items: center;
    gap: 4px; min-height: 24px;
}
.ep-doc-title {
    font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-signers { display: flex; flex-direction: column; gap: 4px; }
.ep-signer { font-size: 0.82rem; }
.ep-signer-name {
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Details-Schritt: kompaktes 2-Spalten-Grid — passt OHNE Scroll in die Box */
.ep-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 5px var(--space-md); align-items: start;
}
.ep-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ep-field .es-label { margin-top: 0; font-size: 0.66rem; }
.ep-field .input-field { padding-top: 6px; padding-bottom: 6px; }
.ep-compose .es-message { resize: none; height: 40px; min-height: 40px; }
.ep-seq-toggle { margin-top: 4px; font-size: 0.78rem; }

/* Sende-Zusammenfassung (Details-Schritt): eine kompakte Zeile */
.ep-sum {
    flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted);
    padding: 3px 10px; background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Quellen-Tabs (segmentierte Pills — vorher ungestylte weiße Buttons) */
.ep-source-tabs { flex-shrink: 0; display: flex; justify-content: center; gap: var(--space-sm); }
/* Zentrierte Sekundär-Elemente (Muster: der Rest der Editor-Felder) */
.ep-center > .es-signer-add, .ep-center > .ep-dropzone, .ep-center .ep-send { align-self: center; }
.fe-sum-chips { justify-content: center; }
.ep-sum { align-self: stretch; text-align: center; }

/* „Verträge"-Tab: ×-Knopf im Tab (entfernt den Tab für diesen Datensatz) */
.cp-tab .cp-tab-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; margin-left: 7px; border-radius: 50%;
    font-size: 0.72rem; line-height: 1; color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06); cursor: pointer;
    transition: var(--transition-fast);
}
.cp-tab .cp-tab-x:hover { color: #fff; background: rgba(220, 38, 38, 0.75); }

/* Ghost beim Palette-Drag (halbtransparent, folgt dem Cursor) */
.fe-marker.fe-ghost { opacity: 0.65; pointer-events: none; z-index: 8; }
.fe-pal { cursor: grab; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.fe-pal:active { cursor: grabbing; }
.fe-pal-ic { display: inline-flex; }
.fe-pal-ic svg { width: 13px; height: 13px; }

/* ═══ Live-Ansicht (P6): wo ist der Kunde gerade im Dokument? ═══════════════ */
.lv-status { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: var(--space-sm); flex-wrap: wrap; }
.lv-chip {
    padding: 2px 9px; border-radius: var(--radius-full);
    color: #fff; font-size: 0.7rem; font-weight: 700; white-space: nowrap;
    opacity: 0.55;
}
.lv-chip.is-on { opacity: 1; box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35); }
/* Lese-Band: der Ausschnitt, den der Unterzeichner gerade im Blick hat */
.lv-band {
    position: absolute; z-index: 6; pointer-events: none;
    border-top: 2px solid; border-bottom: 2px solid; border-radius: 3px;
    transition: top 0.6s ease, height 0.6s ease;
}
.lv-band:not(.is-live) { opacity: 0.35; }
.lv-band-label {
    position: absolute; top: -1px; left: 6px; transform: translateY(-100%);
    padding: 1px 7px; border-radius: 4px 4px 0 0;
    color: #fff; font-size: 0.66rem; font-weight: 700; white-space: nowrap;
}
.lv-band.fe-c1 .lv-band-label { background: #6366f1; }
.lv-band.fe-c2 .lv-band-label { background: #10b981; }
.lv-band.fe-c3 .lv-band-label { background: #f59e0b; }
.lv-band.fe-c4 .lv-band-label { background: #ec4899; }
.lv-events {
    flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px var(--space-md);
    font-size: 0.72rem; color: var(--text-muted); padding-top: 6px;
    border-top: 1px solid var(--glass-border);
}
.lv-event b { color: var(--text-secondary); font-weight: 600; }
/* P7: Live-Cursor des Kunden (WebSocket-Frames) — Punkt in Signer-Farbe,
   kurze Transition glättet die ~80-ms-Frames zu einer flüssigen Bewegung. */
.lv-cursor {
    position: absolute; z-index: 8; pointer-events: none;
    transform: translate(-50%, -50%);
    border: none; background: none;
    transition: left 0.12s linear, top 0.12s linear;
}
.lv-cursor-dot {
    display: block; width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25), 0 1px 4px rgba(0, 0, 0, 0.4);
}
.lv-cursor.fe-c1 .lv-cursor-dot { background: #6366f1; }
.lv-cursor.fe-c2 .lv-cursor-dot { background: #10b981; }
.lv-cursor.fe-c3 .lv-cursor-dot { background: #f59e0b; }
.lv-cursor.fe-c4 .lv-cursor-dot { background: #ec4899; }
/* P7: Feld-Overlay — zeigt, WO jeder Unterzeichner unterschreibt (Farbe je
   Signer wie im Editor); Puls solange sein Bestätigungs-Popup offen ist,
   ✓ + grün sobald unterschrieben (das PDF darunter ist dann frisch
   gestempelt). */
.lv-field {
    position: absolute; z-index: 5; pointer-events: none;
    border: 2px dashed; border-radius: 4px;
}
.lv-field.is-done {
    border-style: solid; border-color: #34d399;
    background: rgba(52, 211, 153, 0.16);
}
.lv-field-check {
    position: absolute; top: -9px; right: -9px; display: inline-flex;
    color: #34d399; background: var(--bg-secondary, #12152a);
    border-radius: 50%;
}
.lv-field-check svg { width: 17px; height: 17px; }
.lv-field.is-hot { animation: lv-field-pulse 1.1s ease-in-out infinite; }
@keyframes lv-field-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.28); }
}
.sp-tab {
    padding: 6px 14px; font-size: 0.82rem; font-weight: 600;
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-full);
    cursor: pointer; transition: var(--transition-fast);
}
.sp-tab:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }
.sp-tab.is-active {
    background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-accent);
}

.ep-files { display: flex; flex-direction: column; gap: 6px; }
.ep-file { flex-shrink: 0; }
.ep-file {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 7px 10px; background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); cursor: pointer; text-align: left;
    color: var(--text-secondary); transition: var(--transition-fast);
}
.ep-file:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.ep-file.is-active { border-color: var(--text-accent); color: var(--text-primary); background: rgba(99,102,241,0.08); }
.ep-file-name { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-file-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Auge-Icon: öffnet die Popup-Vorschau der Datei */
.ep-eye {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex: 0 0 auto;
    background: transparent; border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    cursor: pointer; transition: var(--transition-fast);
}
.ep-eye:hover { color: var(--text-accent); border-color: var(--glass-border-hover); }
.ep-eye svg { width: 14px; height: 14px; }

/* Nativer (weißer) File-Input bleibt versteckt (Trigger = .ep-dropzone) */
.ep-upl-input { display: none; }

/* Vorschau-Popup (Auge): Overlay + Karte mit pdf.js-Viewer */
.ep-pv-overlay {
    position: fixed; inset: 0; z-index: 9500;
    background: rgba(8, 10, 20, 0.62); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-lg);
}
.ep-pv-modal {
    width: min(860px, 94vw); height: min(84vh, 940px);
    display: flex; flex-direction: column; gap: var(--space-sm);
    background: var(--bg-base, #0b0e1a);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: var(--space-md);
}
.ep-pv-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.ep-pv-title { font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-pv-close { font-size: 1.05rem; padding: 2px 10px; }
.ep-pv-modal .ep-pdfv {
    flex: 1; min-height: 0;
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
}
.ep-send { font-weight: 700; }

/* pdf.js-Viewer (mehrseitig, Zeremonie + Profil-Vorschau) */
.sp-pdfv, .ep-pdfv { overflow-y: auto; background: #2a2d3a; padding: 8px; }
.pdfv-page { display: block; margin: 0 auto 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.45); background: #fff; }
.pdfv-note { color: #cbd2e1; font-size: 0.8rem; text-align: center; padding: 12px 0; }

/* ═══ Feld-Editor (P5): Marker fürs Platzieren von Unterschrift/Datum ═══════ */
.fe-modal { width: min(1020px, 96vw); height: min(90vh, 1000px); }
.fe-head { flex-wrap: wrap; gap: var(--space-sm); }
.fe-tools { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }
.fe-signer-sel { max-width: 15rem; padding: 6px 10px; }
.fe-hint { flex-shrink: 0; font-size: 0.78rem; color: var(--text-muted); }
.fe-scroll { flex: 1; min-height: 0; overflow-y: auto; border: 1px solid var(--glass-border); border-radius: var(--radius-md); }
.fe-canvas { position: relative; padding: 0; }
.fe-canvas.is-placing { cursor: crosshair; }
/* Im Editor scrollt .fe-scroll — der Viewer selbst wächst mit dem Inhalt. */
.fe-modal .fe-pdfv { overflow: visible; flex: none; height: auto; min-height: 200px; border: none; border-radius: 0; }

.fe-marker {
    position: absolute; z-index: 6;
    border: 2px solid; border-radius: 4px;
    display: flex; align-items: flex-start; justify-content: space-between;
    cursor: grab; touch-action: none;
    font-size: 0.68rem; font-weight: 700; line-height: 1.1;
}
.fe-marker:active { cursor: grabbing; }
.fe-marker-label {
    padding: 1px 4px; border-bottom-right-radius: 4px;
    color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100% - 18px); pointer-events: none;
}
.fe-marker-rm {
    width: 16px; height: 16px; border: none; border-top-right-radius: 2px;
    color: #fff; background: rgba(0, 0, 0, 0.35); cursor: pointer;
    font-size: 0.72rem; line-height: 1; padding: 0;
}
.fe-marker-rm:hover { background: rgba(220, 38, 38, 0.8); }
/* Signer-Palette (1-basiert, zyklisch) — Marker-Rahmen/Fläche + Label/Chip */
.fe-c1 { border-color: #6366f1; background: rgba(99, 102, 241, 0.18); }
.fe-c1 .fe-marker-label, .fe-chip.fe-c1 { background: #6366f1; }
.fe-c2 { border-color: #10b981; background: rgba(16, 185, 129, 0.18); }
.fe-c2 .fe-marker-label, .fe-chip.fe-c2 { background: #10b981; }
.fe-c3 { border-color: #f59e0b; background: rgba(245, 158, 11, 0.18); }
.fe-c3 .fe-marker-label, .fe-chip.fe-c3 { background: #f59e0b; }
.fe-c4 { border-color: #ec4899; background: rgba(236, 72, 153, 0.18); }
.fe-c4 .fe-marker-label, .fe-chip.fe-c4 { background: #ec4899; }

/* Schritt „Felder": Zusammenfassung + Chips — mittig wie die anderen Felder */
.fe-sum { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.fe-sum-line { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); font-size: 0.85rem; color: var(--text-secondary); }
.fe-auto-badge { color: var(--success); border-color: rgba(52, 211, 153, 0.35); }
.fe-sum-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fe-chip {
    padding: 2px 9px; border-radius: var(--radius-full);
    color: #fff; font-size: 0.7rem; font-weight: 700; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Booking — IT cockpit card + availability week editor (ws-*)
   (split out of the former _booking.css — keep the build-css.sh order intact)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared: chips, rows, ranges (cockpit + admin + editor) ───────────────── */
.ws-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.ws-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.ws-chip:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.ws-chip.active {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
    border-color: transparent;
    color: #fff;
}

.ws-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
@media (max-width: 720px) { .ws-field-row { grid-template-columns: 1fr; } }

.ws-range { width: 100%; accent-color: var(--accent); }
.ws-link-row { display: flex; gap: var(--space-sm); align-items: stretch; }
.ws-link-row .input-field { flex: 1 1 auto; min-width: 0; }
.ws-link-row .btn { flex: 0 0 auto; text-decoration: none; display: inline-flex; align-items: center; }
.ws-inline-ic { display: inline-flex; width: 14px; height: 14px; vertical-align: -2px; }
.ws-cap-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border-subtle);
}
.ws-policy-warn {
    margin: 0 0 var(--space-md);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .10);
    color: #f59e0b;
    font-size: 13px;
    font-weight: 500;
}

/* ── Week editor: segmented weekday rows (Calendly-style) ────────────────── */
.ws-week { display: flex; flex-direction: column; gap: 8px; }
.ws-day-row {
    display: grid;
    grid-template-columns: minmax(130px, 160px) 1fr 32px;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border-subtle);
    background: var(--bg-input);
    transition: border-color .15s ease, background .15s ease;
}
.ws-day-row.on {
    border-color: rgba(99, 102, 241, .45);
    background: linear-gradient(90deg, rgba(99, 102, 241, .08), transparent 60%), var(--bg-input);
}
.ws-day-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    user-select: none;
}
.ws-day-row.on .ws-day-toggle { color: var(--text-primary); font-weight: 600; }

/* iOS-style switch instead of a bare checkbox */
.ws-week .ws-day-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    margin: 0;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .15s ease, border-color .15s ease;
}
.ws-week .ws-day-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: left .15s ease, background .15s ease;
}
.ws-week .ws-day-toggle input[type="checkbox"]:checked {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
    border-color: transparent;
}
.ws-week .ws-day-toggle input[type="checkbox"]:checked::after { left: 18px; background: #fff; }

.ws-day-times {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    transition: opacity .15s ease;
}
.ws-day-times.muted { opacity: .35; }
.ws-time { width: 108px; text-align: center; font-variant-numeric: tabular-nums; }
.ws-time::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
.ws-dash { color: var(--text-muted); }
.ws-day-copy {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all .12s ease;
}
.ws-day-copy:hover { color: var(--text-primary); border-color: var(--accent); }
@media (max-width: 640px) {
    .ws-day-row { grid-template-columns: 1fr; gap: 8px; }
    .ws-day-times { justify-content: flex-start; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Booking — public guest-facing page (book-*)
   (split out of the former _booking.css — keep the build-css.sh order intact)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   Public booking page — standalone, guest-facing. No app shell.
   ═══════════════════════════════════════════════════════════════════════════ */
.book-public {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--accent-soft, rgba(99,102,241,.10)), transparent),
        var(--bg-primary);
}
.book-card {
    width: 100%;
    max-width: 560px;
    padding: 32px;
    border-radius: var(--radius-xl, 20px);
    /* Smooth width morph when the public card shrinks from step 1 (1100px calendar
       layout) to step 2 (560px confirmation). Inert on the static 560px cards. */
    transition: max-width .28s cubic-bezier(.22, 1, .36, 1);
}

.book-head { text-align: center; margin-bottom: 20px; }
.book-head h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.book-host { color: var(--text-secondary); font-size: 15px; margin: 0; }
.book-note { color: var(--text-muted); font-size: 14px; margin: 8px 0 0; }

.book-durations {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: 20px 0 6px;
}
.book-durations .ws-chip { padding: 8px 18px; font-size: 14px; }

.book-tz { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 16px; }
.book-tz-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.book-tz-select {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}
.book-tz-select:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }

/* Terminarten as selectable cards */
.book-types { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0 6px; }
.book-type {
    text-align: left;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    /* Colour continuity: the SAME accent the admin configured on the type card. */
    border-left: 3px solid var(--bt-accent, var(--glass-border));
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    transition: all .12s ease;
}
.book-type b { color: var(--text-primary); font-size: 15px; }
.book-type-dur { color: var(--text-accent, var(--accent)); font-size: 13px; font-weight: 600; }
.book-type-loc { color: var(--text-muted); font-weight: 500; }
.book-type p { width: 100%; margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }
.book-type:hover { border-color: var(--accent); border-left-color: var(--bt-accent, var(--accent)); }
.book-type.active {
    border-color: var(--accent);
    border-left-color: var(--bt-accent, var(--accent));
    background: var(--accent-soft, rgba(99, 102, 241, .12));
    box-shadow: 0 0 0 1px var(--accent);
}

.book-slots { display: flex; flex-direction: column; gap: 16px; max-height: 380px; overflow-y: auto; }
.book-day-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
}
.book-day-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
}
.book-slot {
    padding: 10px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
}
.book-slot:hover { border-color: var(--accent); color: var(--text-accent, var(--accent)); }
.book-slot.active {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
    border-color: transparent;
    color: #fff;
}

.book-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.book-form h3 { margin: 0 0 4px; font-size: 16px; color: var(--text-primary); }
.book-submit { margin-top: 6px; }

.book-done, .book-empty { text-align: center; padding: 32px 8px; }
.book-done h2, .book-empty h2 { font-size: 22px; color: var(--text-primary); margin: 12px 0 6px; }
.book-done p, .book-empty p { color: var(--text-secondary); margin: 0; }
.book-check {
    width: 56px; height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
}

.book-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .3px;
}

/* ═══ Calendly-style split layout (public page v2) ═══════════════════════ */
/* Reactive width: with no day selected the card only needs the left panel + the
   480px calendar (narrower, no dead space on the right); when a day is picked and
   the 200px times column appears (`.on-times`, step 1 only) the card grows to hold
   both side by side. The calendar column stays a FIXED 480px throughout, so it
   never rescales — only the card's outer width morphs (transition on .book-card). */
.book-wide { max-width: 880px; padding: 0; overflow: hidden; }
.book-wide.on-times { max-width: 1100px; }
.book-wide .book-empty, .book-wide .book-done { padding: 56px 32px; }
.book-wide .book-footer { padding: 0 28px 18px; margin-top: 8px; }

.book-split {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 480px;
}

/* Left: info panel */
.book-left {
    padding: 28px 26px;
    border-right: 1px solid var(--glass-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.book-left-host {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
}
.book-left-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.book-left-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.book-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.book-meta-ic { opacity: .8; }
.book-left .book-note { margin: 0; text-align: left; }
.book-left .book-types { margin: 8px 0 0; }
.book-left .book-durations { justify-content: flex-start; margin: 8px 0 0; }

/* Right: date & time / form */
.book-right { padding: 28px; min-width: 0; }
.book-right-title { margin: 0 0 18px; font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* The calendar column is a FIXED 480px in BOTH states (with/without times), so
   the month grid never rescales when the times column appears — it just slots in
   to the right of the reserved space. justify-content keeps the calendar pinned
   left instead of stretching. Collapses to one column on narrow viewports below. */
.book-datetime { display: grid; grid-template-columns: 480px; gap: 20px; justify-content: start; }
.book-datetime.with-times { grid-template-columns: 480px 200px; }

/* Month calendar (booking public page — scoped `bkc-` prefix to avoid
   colliding with the standalone calendar page's `.cal-*` grid classes) */
.bkc-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bkc-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.bkc-nav-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all .12s ease;
}
.bkc-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-primary); }
.bkc-nav-btn:disabled { opacity: .3; cursor: default; }

.bkc-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.bkc-week span {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .5px;
}
.bkc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bkc-cell { aspect-ratio: 1; min-height: 38px; }
.bkc-cell.day {
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: default;
    transition: all .12s ease;
}
.bkc-cell.day.avail {
    background: var(--accent-soft, rgba(99, 102, 241, .14));
    color: var(--text-accent, var(--accent));
    font-weight: 700;
    cursor: pointer;
}
.bkc-cell.day.avail:hover { background: rgba(99, 102, 241, .28); }
.bkc-cell.day.avail.sel {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #fff;
}

/* Times column beside the calendar */
.book-times { min-width: 0; }
.book-times-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
}
/* Bigger, chunkier slot buttons in the public booker's time column. */
.book-times-list .book-slot { width: 100%; padding: 15px 0; font-size: 15px; }

/* Step 2: back + summary */
.book-back {
    background: transparent;
    border: none;
    color: var(--text-accent, var(--accent));
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 10px;
}
.book-back:hover { text-decoration: underline; }
.book-summary {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 14px;
    background: var(--accent-soft, rgba(99, 102, 241, .12));
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
.book-right .book-form { margin-top: 0; padding-top: 0; border-top: none; }

/* Step 2 (guest details) is a narrow form column — not stretched full width.
   Left-aligned to line up with the calendar's left edge from step 1. */
.book-guest { max-width: 480px; }

/* ═══ Step 2 (guest confirmation) — shrink + collapse the wide card ═══════
   On step 1 the card is 1100px wide because it holds the fixed-480px month
   calendar + 200px times column side by side. On step 2 there's only a small
   2-field form, so the wide footprint + 480px min-height leave big empty areas
   to the RIGHT of and BELOW the form. Fix: when `step == 2`, `.on-step2` is on
   the card (public.rs only — internal.rs never uses `.book-wide`), so we narrow
   the card to 560px, collapse the split to ONE column, drop the min-height floor
   and hide the tall left rail (its context is re-presented in the summary
   header). Every rule is scoped under `.book-wide.on-step2`, so step 1 and the
   shared bare `.book-split`/`.book-right`/`.book-summary` are untouched. */
/* Step 2 is a short card — center it fully in the viewport: horizontally via the
   parent .book-public (justify-content:center), vertically via align-self:center
   (overrides the parent's align-items:flex-start for THIS child only, so step 1
   stays top-pinned). */
.book-wide.on-step2 { max-width: 560px; align-self: center; }

/* Collapse the 2-col split to a single column and remove the 480px floor so the
   card hugs the short form (kills the lower dead zone). */
.book-wide.on-step2 .book-split {
    grid-template-columns: 1fr;
    min-height: 0;
}

/* The tall info/calendar rail isn't needed on the confirmation step — the chosen
   Terminart is already committed and the host + date/time are re-shown in the
   summary header below. Hiding it removes the empty column beside the form. */
.book-wide.on-step2 .book-left { display: none; }

/* Right column becomes the full (single) column; comfortable padding, no height. */
.book-wide.on-step2 .book-right { padding: 32px; }

/* The guest block now owns the full narrow card width (no 480px left cap, no
   dead space to the right). Subtle entrance so the resize feels deliberate. */
.book-wide.on-step2 .book-guest {
    max-width: 100%;
    animation: bookGuestIn .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes bookGuestIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* Promote the summary pill into a proper confirmed-booking header: host line +
   date/time line, stacked. `.book-summary-lg` is a MODIFIER (public.rs only), so
   internal.rs's bare `.book-summary` (its confirm/reschedule pill) is unchanged. */
.book-wide.on-step2 .book-summary.book-summary-lg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.book-summary-host {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.book-summary-when {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-accent, var(--accent));
}

/* A touch more breathing room above the header on step 2. */
.book-wide.on-step2 .book-back { margin-bottom: 12px; }

/* Below the width that fits the fixed 500px calendar + times side by side, drop
   to a single flexible column (calendar full-width, times stack underneath) —
   still no rescale between states, since the column count no longer changes. */
@media (max-width: 1120px) {
    .book-datetime, .book-datetime.with-times { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .book-split { grid-template-columns: 1fr; }
    .book-left { border-right: none; border-bottom: 1px solid var(--glass-border-subtle); }
}


/* Public upload page /upload/:token — mobile-first, dark, standalone */

.upl-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg-primary);
}

.upl-card {
    width: 100%;
    max-width: 560px;
}

.upl-tenant {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 4px;
}

.upl-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.upl-sub {
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
    margin: 0 0 16px;
}

.upl-error {
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    font-size: 0.86rem;
}

.upl-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.upl-input {
    background: var(--bg-input, rgba(6, 10, 20, 0.6));
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    padding: 12px 14px;
}

.upl-input:focus {
    outline: none;
    border-color: var(--glass-border-hover);
}

.upl-primary {
    margin-top: 6px;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.upl-primary:hover {
    background: var(--accent-hover, #818cf8);
}

.upl-primary:disabled {
    opacity: 0.5;
    cursor: default;
}

.upl-progress {
    margin: 12px 0 16px;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-bg);
    font-size: 0.86rem;
    font-weight: 600;
}

.upl-complete {
    margin: 12px 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    font-size: 0.86rem;
    font-weight: 600;
}

.upl-positions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upl-pos {
    padding: 14px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
}

.upl-pos.is-done {
    border-color: rgba(52, 211, 153, 0.35);
}

.upl-pos-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.upl-pos-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.upl-req,
.upl-opt {
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.upl-req {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.upl-opt {
    background: rgba(100, 116, 139, 0.18);
    color: var(--text-muted, #94a3b8);
}

.upl-hint {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
}

.upl-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.07);
}

.upl-file-name {
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upl-file-del {
    border: none;
    background: transparent;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.upl-add {
    margin-top: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 1px dashed rgba(99, 102, 241, 0.45);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-light, #a5b4fc);
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.upl-add:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: var(--accent);
}

.upl-add:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Booking — admin Terminarten / teams / modal editor (bk-*, tm-*)
   (split out of the former _booking.css — keep the build-css.sh order intact)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Admin Terminart modal: "Ersteller bevorzugen" toggle row. */
.bk-prefer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Admin save-feedback error variant (reuse of the call-settings feedback) */
.save-feedback.err { color: var(--danger); }

/* ── Admin: team booking links ────────────────────────────────────────────── */
.ws-teamlinks { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-md); }
.ws-teamlink-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--bg-input);
}
.ws-teamlink-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-teamlink-main b { color: var(--text-primary); font-size: 14px; }
.ws-teamlink-meta { color: var(--text-muted); font-size: 12px; }
.ws-teamlink-url {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 900px) { .ws-teamlink-row { flex-wrap: wrap; } }

/* ── Per-Terminart links (user settings + IT card) ───────────────────────── */
.ws-typelinks { display: flex; flex-direction: column; gap: 8px; }
.ws-typelink-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border-subtle);
    background: var(--bg-input);
}
.ws-typelink-name { display: flex; align-items: baseline; gap: 8px; min-width: 160px; }
.ws-typelink-name b { color: var(--text-primary); font-size: 13px; }
.ws-typelink-dur { color: var(--text-accent, var(--accent)); font-size: 12px; font-weight: 600; }
.ws-typelink-url {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
@media (max-width: 720px) { .ws-typelink-row { flex-wrap: wrap; } .ws-typelink-url { width: 100%; } }

/* ── Admin → Buchung: drill-in sub-menu (list → detail) ───────── */
.bk-root { max-width: 920px; }

/* Category list (full width) */
.bk-menu-head { padding: 2px 2px 18px; }
.bk-menu-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.bk-menu-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 3px; }
.bk-menu-list { display: flex; flex-direction: column; gap: 10px; }
.bk-menu-item {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 15px 18px; border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    cursor: pointer; text-align: left; font-family: var(--font-sans);
    transition: border-color var(--transition-fast), background var(--transition-fast),
                transform var(--transition-fast);
}
.bk-menu-item:hover {
    border-color: var(--glass-border-hover); background: var(--bg-hover);
    transform: translateY(-1px);
}
.bk-menu-ic {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-hover);
}
.bk-menu-ic svg { width: 19px; height: 19px; }
.bk-menu-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-menu-label { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.bk-menu-desc { font-size: 0.8rem; color: var(--text-secondary); }
.bk-menu-chevron { display: inline-flex; flex: 0 0 auto; color: var(--text-muted); }
.bk-menu-chevron svg { width: 18px; height: 18px; }

/* Neutral count pill (Terminarten / Teams). */
.bk-count-pill {
    flex: 0 0 auto; min-width: 22px; text-align: center;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(99, 102, 241, 0.18); color: var(--accent-hover);
    font-size: 0.75rem; font-weight: 700;
}

/* Detail (settings) view — back button + one pane, full width */
.bk-back {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px 7px 10px; margin-bottom: 18px;
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    background: var(--glass-bg); color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 600; font-family: var(--font-sans);
    cursor: pointer; transition: all var(--transition-fast);
}
.bk-back:hover { color: var(--text-primary); border-color: var(--glass-border-hover); background: var(--bg-hover); }
.bk-back-chev { display: inline-flex; transform: rotate(180deg); }
.bk-back-chev svg { width: 15px; height: 15px; }

/* ── Terminart card gallery ── */
.bk-et-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
}
.bk-et-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 15px 16px 12px; border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-top: 3px solid var(--accent); cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast),
                box-shadow var(--transition-fast);
}
.bk-et-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,0.3));
    border-color: var(--glass-border-hover);
}
.bk-et-card-top { display: flex; align-items: center; gap: 9px; }
.bk-et-card-name { flex: 1 1 auto; min-width: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-et-cardsw { border: none; background: none; padding: 0; cursor: pointer; }
.bk-et-card-dur { font-size: 0.8rem; font-weight: 600; color: var(--accent-hover); }
.bk-et-card-count { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.bk-et-card-loc {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-loc-ic { display: inline-flex; width: 13px; height: 13px; flex: 0 0 auto; color: var(--text-muted); }
.bk-loc-ic svg { width: 13px; height: 13px; }
.bk-loc-input { margin-top: 10px; }

/* Drag-reorder states (FLIP glide via the shared admin helper) */
.bk-et-card { cursor: grab; }
.bk-et-card:active { cursor: grabbing; }
.bk-et-card.is-dragging { opacity: 0.45; }
.bk-et-cards.is-dnd .bk-et-card { transition: none; } /* FLIP owns the motion */

/* Icon buttons on the card foot (duplicate / delete) */
.bk-et-foot-acts { display: inline-flex; gap: 2px; }
.bk-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: none; border-radius: 7px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    transition: all var(--transition-fast);
}
.bk-icon-btn svg { width: 14px; height: 14px; }
.bk-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.bk-icon-btn.danger:hover { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.bk-et-card-desc { font-size: 0.8rem; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-et-card-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 4px; }
.bk-et-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--glass-border);
}
.bk-et-editlink { font-size: 0.78rem; font-weight: 600; color: var(--accent-hover); }
.bk-et-del {
    border: none; background: none; cursor: pointer; padding: 2px 4px;
    font-size: 0.78rem; font-weight: 600; color: var(--text-muted); transition: color var(--transition-fast);
}
.bk-et-del:hover { color: var(--danger); }

/* Assigned-team chip on a card */
.bk-team-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.68rem; font-weight: 600; color: var(--accent-hover);
    padding: 2px 8px; border-radius: 999px;
    background: rgba(99, 102, 241, 0.14); border: 1px solid rgba(99, 102, 241, 0.3);
}
.bk-team-chip-ic { display: inline-flex; width: 12px; height: 12px; flex: 0 0 auto; }
.bk-team-chip-ic svg { width: 12px; height: 12px; }
.bk-team-strat { color: var(--text-muted); font-weight: 500; }
/* Live-but-dead diagnosis: teams assigned, yet no member is routable. */
.bk-team-chip.warn {
    color: #fbbf24; background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}
.bk-team-chip.warn .bk-team-strat { color: #fbbf24; }

/* "+" add card */
.bk-et-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; min-height: 120px; border-radius: var(--radius-md);
    border: 1.5px dashed var(--glass-border-hover); background: transparent;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer;
    font-family: var(--font-sans); transition: all var(--transition-fast);
}
.bk-et-add:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-soft); }
.bk-et-add-plus { font-size: 1.8rem; line-height: 1; color: var(--accent-hover); }

.bk-et-dot {
    width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.bk-et-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: var(--space-md); align-items: start; }
.bk-et-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-md); align-items: start; }
.bk-et-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.bk-et-conds {
    border-top: 1px solid var(--glass-border); padding-top: var(--space-sm); margin-top: var(--space-xs);
}
.bk-et-conds-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); margin-bottom: 6px;
}

/* Colour picker + preset swatches */
.bk-color-row { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.bk-color {
    width: 40px; height: 32px; padding: 0; border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); background: var(--bg-input); cursor: pointer;
}
.bk-color::-webkit-color-swatch-wrapper { padding: 3px; }
.bk-color::-webkit-color-swatch { border: none; border-radius: 4px; }
.bk-swatch {
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: transform var(--transition-fast);
}
.bk-swatch:hover { transform: scale(1.12); }

.bk-cond {
    font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
    padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

/* Compact strategy dropdown on team rows + the create bar */
.bk-strat-sel { flex: 0 0 auto; width: auto; min-width: 152px; }

/* ── Team gallery (Teams & Round-Robin pane) ── */
/* Icon centered inside the color dot on team cards + the modal head. */
.bk-team-icondot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: #fff; }
.bk-team-icondot svg { width: 15px; height: 15px; }
/* Icon-only variant of the pill picker (color + icon presets). */
.bk-iconopt { padding: 8px 11px; }
.bk-iconopt .bk-loc-ic { width: 17px; height: 17px; }
.bk-iconopt .bk-loc-ic svg { width: 17px; height: 17px; }
/* Link chip on a team card (copy affordance). */
.bk-link-chip { border: none; cursor: pointer; font-family: var(--font-sans); }

/* Overlapping member-avatar stack */
.tm-avatars { display: flex; align-items: center; min-height: 30px; padding-left: 8px; }
.tm-av {
    width: 30px; height: 30px; border-radius: 50%; margin-left: -8px; flex: 0 0 auto;
    border: 2px solid var(--bg-input);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
}
.tm-av.leader { box-shadow: 0 0 0 2px var(--bg-input), 0 0 0 3px #fbbf24; }
.tm-av-ghost { opacity: 0.5; }
.tm-av-more {
    margin-left: -8px; height: 30px; padding: 0 9px; border-radius: 999px;
    display: inline-flex; align-items: center; border: 2px solid var(--bg-input);
    background: var(--bg-hover); color: var(--text-secondary); font-size: 0.7rem; font-weight: 700;
}
.tm-av-sm { width: 26px; height: 26px; margin-left: 0; border: none; font-size: 0.62rem; }

/* Modal member roster + live search */
.tm-roster { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tm-chip {
    display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px;
    background: var(--bg-input); border: 1px solid var(--glass-border);
}
.tm-chip.leader { border-color: rgba(251, 191, 36, 0.5); }
.tm-chip-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tm-chip-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-chip-email { font-size: 0.72rem; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-star {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: none; border-radius: 7px; cursor: pointer;
    background: transparent; color: var(--text-muted); transition: all var(--transition-fast);
}
.tm-star .bk-loc-ic, .tm-star .bk-loc-ic svg { width: 15px; height: 15px; }
.tm-star:hover { background: var(--bg-hover); color: #fbbf24; }
.tm-star.on { color: #fbbf24; }
.tm-add-row { position: relative; }
.tm-suggest {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 4px; max-height: 240px; overflow-y: auto;
}
.tm-suggest-item {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    padding: 7px 8px; border: none; border-radius: 7px; background: transparent; cursor: pointer;
    font-family: var(--font-sans); transition: background var(--transition-fast);
}
.tm-suggest-item:hover { background: var(--bg-hover); }
.tm-suggest-add { display: inline-flex; width: 15px; height: 15px; color: var(--accent-hover); flex: 0 0 auto; }
.tm-suggest-add svg { width: 15px; height: 15px; }

/* Modal booking-link bar */
.tm-linkbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tm-slug {
    flex: 1 1 auto; min-width: 0; font-family: monospace; font-size: 0.78rem; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--glass-border);
}
.tm-linkctl { display: flex; align-items: center; gap: 14px; }

/* ── Terminart modal editor ── */
.bk-modal-backdrop {
    /* Portalled to <body>, so this fixed backdrop is truly viewport-relative. */
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 4vh 16px; overflow-y: auto;
}
.bk-modal {
    width: 560px; max-width: 100%;
    /* Cap the MODAL (not just the body) to the viewport, so head + foot stay
       pinned and only the body scrolls if a very short window ever needs it.
       Content is compacted to fit one normal screen without scrolling at all. */
    max-height: 92vh;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    animation: bkModalIn 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bkModalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.bk-modal-head {
    flex: 0 0 auto;                 /* pinned; never shrinks or scrolls */
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px; border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 1px 0 var(--glass-border);  /* subtle frame vs scrolling body */
}
.bk-modal-title { flex: 1 1 auto; font-size: 1.02rem; font-weight: 700; color: var(--text-primary); }
.bk-modal-x {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    width: 28px; height: 28px; border-radius: 7px; transition: all var(--transition-fast);
}
.bk-modal-x svg { width: 15px; height: 15px; }
.bk-modal-x:hover { background: var(--bg-hover); color: var(--text-primary); }
.bk-modal-body {
    flex: 1 1 auto; min-height: 0;  /* the ONLY scroll region; min-height:0 lets it shrink so overflow engages */
    padding: 14px 18px; display: flex; flex-direction: column; gap: var(--space-sm);
    overflow-y: auto;
    /* max-height:68vh REMOVED — the height cap now lives on .bk-modal. */
}
.bk-modal-foot {
    flex: 0 0 auto;                 /* pinned; always visible, never cut off */
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--glass-border);
    box-shadow: 0 -1px 0 var(--glass-border);  /* subtle frame vs scrolling body */
}
.bk-modal-foot-spacer { flex: 1 1 auto; }

/* Team assignment picker (chips) */
.bk-et-teamhint { font-size: 0.76rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.4; }
.bk-team-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-teamopt {
    display: inline-flex; align-items: center; gap: 7px;  /* icon + label centered & spaced */
    padding: 6px 13px; border-radius: 999px; cursor: pointer; font-family: var(--font-sans);
    background: var(--bg-input); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 0.82rem; font-weight: 600;
    line-height: 1;                                       /* kills baseline drift vs the icon box */
    transition: all var(--transition-fast);
}
/* Crisp icon sizing INSIDE labeled location pills only. Scoped with
   :not(.bk-iconopt) so the Teams icon-only preset pills KEEP their 17px
   (their .bk-iconopt .bk-loc-ic rule has EQUAL specificity, so without this
   :not() the later 15px rule would win and shrink them). */
.bk-teamopt:not(.bk-iconopt) .bk-loc-ic {
    width: 15px; height: 15px; flex: 0 0 auto; color: currentColor;
}
.bk-teamopt:not(.bk-iconopt) .bk-loc-ic svg { width: 15px; height: 15px; display: block; }
.bk-teamopt:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.bk-teamopt.active {
    background: var(--accent-soft); border-color: var(--accent);
    color: var(--accent-hover);
}
.bk-strat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 10px; }
.bk-strat-row .form-label { margin: 0; flex: 0 0 auto; }

@media (max-width: 760px) {
    .bk-et-grid, .bk-et-grid2, .bk-et-grid3 { grid-template-columns: 1fr; }
}


/* ═══ Profile booker — "+ Termin" → Terminart chooser + IN-PANE booker ═════
   Everything happens inside the Termin-tab box: the day agenda hides, the
   "Schließen" button stays, Terminarten show as a 2-column grid, and picking
   one swaps the grid for the booker in the SAME box (back arrow → grid). No
   modal. Reuses the public page's bkc-* month calendar + book-* split verbatim.
   Everything new is namespaced .cpb-* so shared public classes stay untouched. */

/* Day agenda stays mounted but hidden while the in-pane booker is open. */
.cpb-hidden { display: none; }

/* ── Chooser panel (under the "Schließen" button; agenda is hidden) ──────── */
.cpb-chooser {
    margin-top: 10px;
    animation: cpbIn 160ms ease;
}
@keyframes cpbIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.cpb-chooser-head {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 2px 10px;
}
/* Terminarten in a 2-column grid; the "Manuell" box spans the full width. */
.cpb-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.cpb-types .cpb-none {
    grid-column: 1 / -1;
}
@media (max-width: 620px) {
    .cpb-types { grid-template-columns: 1fr; }
}
.cpb-type {
    --cpb-accent: #6366f1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    padding: 10px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--cpb-accent);
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font: inherit;
}
.cpb-type:hover {
    transform: translateY(-1px);
    border-color: var(--glass-border-hover, var(--glass-border));
    border-left-color: var(--cpb-accent);
    background: var(--glass-bg-hover, var(--glass-bg));
}
.cpb-type-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.cpb-type-top b {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cpb-type-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cpb-accent);
    flex: 0 0 auto;
}
.cpb-team-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-soft, rgba(99, 102, 241, 0.12));
    color: var(--accent, #818cf8);
    flex: 0 0 auto;
}
.cpb-type-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.cpb-type-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cpb-type.cpb-skel {
    min-height: 56px;
    pointer-events: none;
    border-left-color: var(--glass-border);
    background: linear-gradient(
        100deg,
        var(--glass-bg) 40%,
        var(--glass-bg-hover, rgba(255, 255, 255, 0.05)) 50%,
        var(--glass-bg) 60%
    );
    background-size: 200% 100%;
    animation: cpbShimmer 1.2s linear infinite;
}
@keyframes cpbShimmer {
    from { background-position: 120% 0; }
    to { background-position: -80% 0; }
}
.cpb-none {
    padding: 6px 2px 2px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.cpb-none p { margin: 0 0 4px; }
.cpb-empty-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ── In-pane booker panel (replaces the grid in the SAME box) ────────────── */
.cpb-panel {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md, 10px);
    background: var(--glass-bg);
    overflow: hidden;
    animation: cpbIn 160ms ease;
}
.cpb-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--glass-border-subtle, var(--glass-border));
}
.cpb-panel-title {
    flex: 1 1 auto;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cpb-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    flex: 0 0 auto;
    transition: all var(--transition-fast);
}
.cpb-back:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover, var(--glass-bg));
    transform: translateX(-1px);
}
.cpb-panel-body { padding: 0; }

/* No left info panel in-pane (removed — the panel head already names the
   Terminart). The booker content is a single centered column: heading, then
   the month calendar with the time slots BESIDE it (right), capped + centered
   so it sits neatly in the profile pane instead of the public 320px+cal split. */
.cpb-split {
    display: block;               /* kill the shared 320px + 1fr grid */
    min-height: 0;
}
/* TWO SEPARATE BOXES side by side: the calendar-picker panel (left) and the
   available-times box (right). The times are a sibling of the panel, NOT inside
   it — so the calendar box never reflows and the times get their own box. */
.cpb-booker {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
}
/* The calendar picker box is LOCKED at a fixed width — grow 0 AND shrink 0, so
   it never changes size whether or not the times box is present beside it.
   `min-width:0` lets the fixed width hold even though the grid is wide (the
   cells shrink via the minmax(0,1fr) rule below). */
.cpb-cal-panel {
    flex: 0 0 430px;
    width: 430px;
    min-width: 430px;
    max-width: 430px;
}
.cpb-split .book-right { max-width: none; margin: 0; padding: 20px; }
.cpb-dt { display: block; }     /* holds only the calendar now */
.cpb-cal { width: 100%; margin: 0; }
/* `repeat(7, 1fr)` = `minmax(auto, 1fr)`, whose `auto` min-size is the cell
   content — in this narrow box the 7 columns can't shrink and Sa/So overflow
   (clipped). `minmax(0, 1fr)` lets them shrink to fit; `min-height:0` drops the
   aspect-ratio's min-size floor. Higher specificity than the shared bkc rules. */
.cpb-cal .bkc-week,
.cpb-cal .bkc-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cpb-cal .bkc-cell { min-height: 0; }

/* Available times — NO wrapping box; the time pills sit bare beside the
   calendar, top-aligned with it, and the column scrolls so it never grows. */
.cpb-times-box {
    flex: 0 0 196px;
    align-self: flex-start;      /* flush with the TOP edge of the calendar box */
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
    animation: cpbIn 160ms ease;
}
.cpb-times-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* Bigger, comfortable time boxes. */
.cpb-slot {
    padding: 14px 10px;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--glass-border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .12s ease;
}
.cpb-slot:hover {
    border-color: var(--accent);
    color: var(--text-accent, var(--accent));
    transform: translateY(-1px);
}
/* Narrow pane: the times drop below the calendar panel. */
@media (max-width: 620px) {
    .cpb-booker { flex-direction: column; align-items: center; }
    .cpb-times-box { flex: 0 0 auto; width: 100%; max-width: 320px; margin-top: 0; }
}
.cpb-tz {
    margin-top: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
/* Host picker (team Terminart, non-member) + "wird dir zugewiesen" note. */
.cpb-hostrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.cpb-hostlabel {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 0 0 auto;
}
.cpb-hostsel { cursor: pointer; flex: 1 1 auto; }
.cpb-hostnote {
    margin: -2px 0 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.cpb-err { display: block; margin-bottom: 10px; }
.cpb-empty { color: var(--text-secondary); font-size: 0.85rem; }
.cpb-empty p { margin: 0 0 6px; }
.cpb-empty .ws-chip { margin-top: 6px; }

/* Invitee form */
.cpb-form h3 { margin-top: 0; }
.cpb-namerow {
    display: flex;
    gap: 10px;
}
.cpb-namerow .input-field { flex: 1 1 0; min-width: 0; }
.cpb-select { cursor: pointer; }
.cpb-hint.warn {
    display: block;
    font-size: 0.72rem;
    color: var(--warning, #f59e0b);
    margin: -4px 0 2px;
}
/* Success pane */
.cpb-done { padding: 48px 32px; }
.cpb-done-when {
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 6px;
}
.cpb-done-mail {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin: 0 0 18px;
}

/* ═══════════════════════════════════════════════════════════════
   WORKSPACE / IT-VERWALTUNG  (/workspace)
   ═══════════════════════════════════════════════════════════════ */
.ws-page { display: flex; flex-direction: column; gap: var(--space-lg); }

.ws-header { display: flex; gap: var(--space-md); align-items: flex-start; }
.ws-header-icon {
    display: inline-flex; width: 28px; height: 28px; color: var(--accent, #818cf8);
    flex: 0 0 auto; margin-top: 2px;
}
.ws-header-icon svg { width: 28px; height: 28px; }
.ws-header h2 { margin: 0; font-size: 1.25rem; }
.ws-subtitle { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-muted); max-width: 60ch; line-height: 1.45; }

.ws-stats { display: flex; gap: var(--space-md); }
.ws-stat {
    font-size: 0.8125rem; color: var(--text-muted);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); padding: 6px 14px;
}
.ws-stat b { color: var(--text-primary); font-size: 0.95rem; margin-right: 4px; }

.ws-table { padding: var(--space-xs); }
.ws-row {
    display: grid; grid-template-columns: 1.4fr 2fr 0.8fr 1fr;
    align-items: center; gap: var(--space-md);
    padding: 10px var(--space-md); border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.ws-row:not(.ws-row-head):hover { background: rgba(255, 255, 255, 0.04); }
.ws-row-head {
    font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid var(--glass-border); border-radius: 0;
}
.ws-name { color: var(--text-primary); font-weight: 600; }
.ws-email { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-role { color: var(--text-muted); }

.ws-badge {
    font-size: 0.6875rem; font-weight: 600; padding: 2px 9px;
    border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.02em;
}
.ws-badge.ok  { color: #34d399; background: rgba(52, 211, 153, 0.14); }
.ws-badge.off { color: var(--text-muted); background: rgba(148, 163, 184, 0.12); }

.ws-hint { font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }

.ws-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0,0,0,0.2); border-radius: var(--radius-md); width: fit-content; }
.ws-tab {
    padding: 7px 16px; border-radius: var(--radius-sm); background: transparent;
    border: none; color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
}
.ws-tab:hover { color: var(--text-primary); }
.ws-tab.active { color: var(--text-primary); background: rgba(99,102,241,0.15); font-weight: 600; }
.ws-orgchart { min-height: 72vh; display: flex; flex-direction: column; }

.ws-row-click { cursor: pointer; }
a.ws-row { text-decoration: none; color: inherit; }
.ws-row { grid-template-columns: 1.5fr 1.9fr 0.7fr 0.9fr 0.9fr 0.8fr 24px; }
.ws-row-click:hover .ws-chevron { color: var(--accent, #818cf8); transform: translateX(2px); }
.ws-name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-name-cell .ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-avatar.sm { width: 30px; height: 30px; font-size: 0.72rem; flex: 0 0 auto; }
.ws-chevron { color: var(--text-muted); font-size: 1.1rem; text-align: right; transition: all 0.15s; }

/* Breadcrumb in the topbar */
.ws-crumb { text-decoration: none; color: var(--text-muted); }
.ws-crumb:hover { color: var(--text-primary); }
.tb-crumb-sep { color: var(--text-muted); margin: 0 2px; }

.ws-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-md); color: var(--text-muted); }

/* Forms in the cockpit use flex-gap spacing — kill the extra margin. */
.eacc-form .form-group { margin-bottom: 0; }

/* ── Per-user provisioning page: Apple-Settings "Cockpit-Rail" ──── */
.ws-settings {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

/* Left rail */
.ws-set-rail {
    position: sticky; top: var(--space-lg);
    display: flex; flex-direction: column; gap: var(--space-sm);
    padding: var(--space-md);
}
.ws-rail-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-rail-identity .ws-detail-id { min-width: 0; }
.ws-rail-identity .ws-detail-id h2 {
    margin: 0; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-rail-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.ws-rail-cats {
    display: flex; flex-direction: column; gap: 2px;
    padding-top: var(--space-sm); border-top: 1px solid var(--glass-border);
}
.ws-set-item {
    display: flex; align-items: center; gap: var(--space-sm); width: 100%;
    padding: 9px 10px; border-radius: var(--radius-sm);
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.85rem; text-align: left;
    transition: all var(--transition-fast);
}
.ws-set-item:hover:not(:disabled) { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.ws-set-item.active { color: var(--text-primary); background: rgba(99,102,241,0.15); font-weight: 600; }
.ws-set-item:disabled { opacity: 0.45; cursor: default; }
.ws-set-ic { display: inline-flex; width: 17px; height: 17px; flex: 0 0 auto; }
.ws-set-ic svg { width: 17px; height: 17px; }
.ws-set-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-set-item .eacc-badge { flex: 0 0 auto; }

.ws-rail-foot {
    font-size: 0.7rem; color: var(--text-muted);
    padding-top: var(--space-sm); border-top: 1px solid var(--glass-border);
}

/* Right pane */
.ws-set-pane { max-width: 720px; min-width: 0; }

/* Identity bits reused from the directory rows */
.ws-back {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-primary); border-radius: var(--radius-sm);
    width: 30px; height: 30px; font-size: 1rem; cursor: pointer; flex: 0 0 auto;
    transition: background 0.15s;
}
.ws-back:hover { background: rgba(255,255,255,0.1); }
.ws-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99,102,241,0.18); color: #a5b4fc;
    font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em;
}
.ws-detail-id { display: flex; flex-direction: column; }
.ws-detail-email {
    font-size: 0.75rem; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-badge.warn { color: #fbbf24; background: rgba(251, 191, 36, 0.14); }

/* Save/action buttons in the settings pane: modern gradient (== teams-btn-save).
   The buttons carry `.btn .btn-primary`, so base padding/shape come from .btn;
   here we swap the flat accent for the gradient + a lift on hover (and re-assert
   the gradient on hover so the base .btn-primary:hover accent doesn't win). */
.ws-settings .btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    border-radius: 8px;
    font-weight: 600;
}
.ws-settings .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

/* Responsive: rail moves on top as a horizontal category bar */
@media (max-width: 900px) {
    .ws-settings { grid-template-columns: 1fr; }
    .ws-set-rail { position: static; }
    .ws-rail-cats { flex-direction: row; flex-wrap: wrap; }
    .ws-set-item { width: auto; }
    .ws-set-item .eacc-badge { display: none; }
    .ws-rail-foot { display: none; }
}

/* ── Provisioning drawer ───────────────────────────────────────── */
.ws-drawer-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
    z-index: 4000; animation: wsFade 0.15s ease;
}
.ws-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
    z-index: 4001; display: flex; flex-direction: column;
    border-radius: 0; border-left: 1px solid var(--glass-border);
    animation: wsSlide 0.18s ease;
}
@keyframes wsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wsSlide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.ws-drawer-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--glass-border);
}
.ws-drawer-head h3 { margin: 0; font-size: 1.1rem; }
.ws-drawer-email { font-size: 0.8125rem; color: var(--text-muted); }
.ws-drawer-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 1.1rem; padding: 4px 8px; border-radius: var(--radius-sm);
}
.ws-drawer-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.ws-drawer-body { flex: 1; overflow-y: auto; padding: var(--space-md) var(--space-lg); display: flex; flex-direction: column; gap: var(--space-lg); }
.ws-drawer-section { display: flex; flex-direction: column; gap: 8px; }
.ws-drawer-section h4 {
    margin: 0 0 2px; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted);
}
.ws-drawer-section .form-label { margin-top: 4px; }

.ws-kv { display: flex; justify-content: space-between; font-size: 0.85rem; }
.ws-kv span { color: var(--text-muted); }
.ws-kv b { color: var(--text-primary); font-weight: 500; }

.ws-toggle { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; margin-top: 6px; }

.ws-drawer-foot {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--glass-border);
}
.ws-drawer-foot .spacer { flex: 1; }

/* Plattform-Cockpit (/platform + /platform/:id) — Super-Admin only.
   Prefix plf- (pf- gehört dem Products-Field-Editor). */

.plf-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 2px 24px;
}

/* ── Kopf ─────────────────────────────────────────────────────────────── */
.plf-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.plf-header .spacer { flex: 1; }
.plf-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    color: #a5b4fc;
    flex-shrink: 0;
}
.plf-header h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #fff;
    display: flex;
    align-items: center;
}
.plf-subtitle {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}
.plf-head-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.plf-crumb { text-decoration: none; }
.plf-crumb:hover { text-decoration: underline; }

/* ── KPI-Kacheln ──────────────────────────────────────────────────────── */
.plf-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.plf-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    border-radius: 14px;
}
.plf-card-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}
.plf-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}
.plf-card-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.plf-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}
.plf-tabs .spacer { flex: 1; }
.plf-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.plf-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.plf-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: #fff;
}
.plf-days { width: 110px; }

/* ── Toolbar: Suche + Status-Filter + Ansicht ─────────────────────────── */
.plf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.plf-toolbar .spacer { flex: 1; }
.plf-searchbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 7px 14px;
    min-width: 240px;
    transition: border-color 0.15s ease;
}
.plf-searchbox:focus-within { border-color: rgba(99, 102, 241, 0.5); }
.plf-searchbox-icon {
    display: inline-flex;
    color: rgba(255, 255, 255, 0.4);
}
.plf-searchbox-icon svg { width: 15px; height: 15px; }
.plf-searchbox input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.85rem;
}
.plf-searchbox input::placeholder { color: rgba(255, 255, 255, 0.35); }

.plf-fpill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.plf-fpill:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.plf-fpill.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
}
.plf-fpill-count {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}
.plf-fpill.active .plf-fpill-count { background: rgba(99, 102, 241, 0.35); color: #fff; }

.plf-viewtoggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}
.plf-viewtoggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.plf-viewtoggle button:hover { color: #fff; }
.plf-viewtoggle button.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.25);
}
.plf-viewtoggle svg { width: 16px; height: 16px; }

.plf-emptybox {
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}
.plf-emptybox p { margin: 0; }

/* ── Tenant-Boxen (Karten-Ansicht, Pipeline-Board-Stil) ───────────────── */
.plf-cardgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.plf-tcard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 14px;
    padding: 16px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.plf-tcard:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}
.plf-tcard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.plf-tcard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.plf-tcard-name {
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plf-tcard-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: -4px;
}
.plf-tcard-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 42px;
    padding: 4px 0;
}
.plf-tcard-spark-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}
.plf-tcard-stats {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}
.plf-tcard-stats b { color: #fff; font-variant-numeric: tabular-nums; }
.plf-tcard-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    margin-top: 2px;
}
.plf-tcard-foot .spacer { flex: 1; }

/* ── Tenants-Tabelle ──────────────────────────────────────────────────── */
.plf-table {
    border-radius: 14px;
    padding: 6px 0;
    overflow-x: auto;
}
.plf-row {
    display: grid;
    grid-template-columns: 1.7fr 1fr 0.9fr 0.7fr 0.7fr 0.9fr 1fr 0.9fr 1.7fr;
    gap: 10px;
    align-items: center;
    padding: 10px 18px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 980px;
}
/* Schlanke 6-Spalten-Variante (Name+Sub · Status · Nutzer · Requests · Aktiv · Aktionen) */
.plf-row-slim {
    grid-template-columns: 1.8fr 0.9fr 0.6fr 0.9fr 1fr 1.6fr;
    min-width: 760px;
}
.plf-row-head.plf-row-slim { min-width: 760px; }
.plf-name-sub {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
}
.plf-row:last-child { border-bottom: none; }
.plf-row:not(.plf-row-head):hover { background: rgba(255, 255, 255, 0.03); }
.plf-row-head {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
}
.plf-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plf-link { color: #fff; text-decoration: none; }
.plf-link:hover { color: #a5b4fc; text-decoration: underline; }
.plf-dim { color: rgba(255, 255, 255, 0.5); }
.plf-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Status-Pillen */
.plf-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.plf-pill-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.plf-pill-locked { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.plf-pill-deleted { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.plf-pill-platform { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }

.plf-badge {
    display: inline-flex;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

/* Zeilen-Aktionen */
.plf-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.plf-act {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.plf-act:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.plf-act-warn:hover { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.plf-act-danger:hover { background: rgba(239, 68, 68, 0.2); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }

.plf-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
}
.plf-empty {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    padding: 12px 0;
}

/* ── Nutzung ──────────────────────────────────────────────────────────── */
.plf-usage-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: start;
}
.plf-panel {
    border-radius: 14px;
    padding: 18px 20px;
}
.plf-panel h3 { margin: 0 0 2px; font-size: 1rem; color: #fff; }
.plf-panel-sub {
    margin: 0 0 14px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}
.plf-h-gap { margin-top: 20px !important; }

.plf-bar-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 70px 150px;
    gap: 10px;
    align-items: center;
    padding: 5px 0;
    font-size: 0.82rem;
}
.plf-bar-label { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.plf-bar-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.plf-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}
.plf-bar-val { text-align: right; font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.plf-bar-sub { color: rgba(255, 255, 255, 0.45); font-size: 0.72rem; }

.plf-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 90px;
    padding: 4px 0 0;
}
.plf-spark-col {
    flex: 1;
    display: flex;
    align-items: flex-end;
    height: 100%;
    min-width: 4px;
}
.plf-spark-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #8b5cf6, #6366f1);
    opacity: 0.85;
}
.plf-spark-col:hover .plf-spark-bar { opacity: 1; }

.plf-mini-table { display: flex; flex-direction: column; }
.plf-mini-row {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 0.5fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.plf-mini-row:last-child { border-bottom: none; }
.plf-mini-head {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
}

/* Benutzer-Tabelle im Tenant-Detail (7 Spalten) */
.plf-users-row {
    grid-template-columns: 1.7fr 0.9fr 0.8fr 0.9fr 0.9fr 0.9fr 1fr;
    min-width: 760px;
}
.plf-user-name { display: block; font-weight: 600; }
.plf-user-mail { display: block; font-size: 0.72rem; }

/* ── Modals ───────────────────────────────────────────────────────────── */
.plf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 22, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4200;
}
.plf-modal {
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    border-radius: 16px;
    padding: 22px 24px;
}
.plf-modal h3 { margin: 0 0 4px; color: #fff; font-size: 1.1rem; }
.plf-modal-sub {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}
.plf-form { display: flex; flex-direction: column; gap: 12px; }
.plf-form .form-group { margin-bottom: 0; }
.plf-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}
.plf-form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.plf-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
.plf-modal .plf-error { margin-top: 12px; }

.plf-created { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.plf-created-row { display: flex; flex-direction: column; gap: 4px; }
.plf-created-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
}
.plf-created code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #fff;
    user-select: all;
}
.plf-recovery { color: #a5b4fc !important; letter-spacing: 0.04em; }

/* ── Tenant-Widget im Firmenprofil (nur Betreiber) ─────────────────────────
   Bewusst in der Profil-Designsprache (cp-widget/cp-detail-row-Tokens),
   nicht im Cockpit-Look — das Widget sitzt zwischen Firmendaten & Kontakten. */

/* Status-Pille im Widget-Header — dezenter als die Cockpit-Pillen */
.cpw-tl-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}
.cpw-tl-pill-active { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.cpw-tl-pill-locked { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.cpw-tl-pill-deleted { background: rgba(239, 68, 68, 0.12); color: #f87171; }

/* Login-Link: eigene Zeile, bricht statt abzuschneiden */
.cpw-tl-url {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.12);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
    word-break: break-all;
    user-select: all;
}

.cpw-tl-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.cpw-tl-spacer { flex: 1; }
.cpw-tl-btn {
    background: transparent;
    border: 1px solid rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.cpw-tl-btn:hover {
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.08);
}
.cpw-tl-btn-danger:hover {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}
.cpw-tl-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
}
.cpw-tl-btn-primary:hover { filter: brightness(1.1); color: #fff; }
.cpw-tl-btn:disabled { opacity: 0.5; cursor: default; }

.cpw-tl-hint {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.cpw-tl-empty { margin-top: 8px; }
.cpw-tl-error {
    margin: 0 0 8px;
    font-size: 0.75rem;
    color: #f87171;
}

/* Durchsuchbarer Picker */
.cpw-tl-search {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.15);
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    margin-bottom: 6px;
}
.cpw-tl-search:focus { border-color: rgba(99, 102, 241, 0.45); }
.cpw-tl-search::placeholder { color: var(--text-muted); }
.cpw-tl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}
.cpw-tl-item:hover { background: rgba(99, 102, 241, 0.08); }
.cpw-tl-item.selected { background: rgba(99, 102, 241, 0.16); }
.cpw-tl-item-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cpw-tl-item-sub { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }
.cpw-tl-chosen {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Analytics-Popup (Klick auf Tenant-Box/Zeile) ─────────────────────── */
.plf-clickable { cursor: pointer; }
.plf-modal--wide { width: min(920px, calc(100vw - 40px)); }

.plf-am-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.plf-am-head .spacer { flex: 1; }
.plf-am-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plf-am-title h3 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plf-am-head .plf-act { text-decoration: none; }
.plf-am-close { font-size: 0.9rem; line-height: 1; }

.plf-am-chips {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.plf-am-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.plf-am-chip-num { font-size: 1.05rem; font-weight: 700; color: #fff; white-space: nowrap; }
.plf-am-chip-label { font-size: 0.66rem; color: rgba(255, 255, 255, 0.5); }
.plf-am-chip-cost { border-color: rgba(245, 158, 11, 0.25); }
.plf-am-chip-cost .plf-am-chip-num { color: #fbbf24; }
.plf-am-chip-rev { border-color: rgba(16, 185, 129, 0.25); }
.plf-am-chip-rev .plf-am-chip-num { color: #34d399; }

.plf-am-split {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 14px;
}
.plf-am-split-track {
    flex: 1;
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}
.plf-am-split-std { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.plf-am-split-ki { background: linear-gradient(90deg, #f59e0b, #f97316); }
.plf-bar-ki { background: linear-gradient(90deg, #f59e0b, #f97316); }

.plf-am-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
    align-items: start;
}
.plf-am-panel h4 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #fff;
}
.plf-bar-row-compact { grid-template-columns: 110px minmax(0, 1fr) 60px 90px; }

.plf-am-urow { grid-template-columns: 1.6fr 0.6fr 0.6fr 0.9fr; }
.plf-am-idle { opacity: 0.55; }
.plf-am-upill { margin-left: 6px; font-size: 0.6rem; padding: 1px 6px; }

.plf-am-money { display: flex; flex-direction: column; }
.plf-am-mrow {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.plf-am-mrow span:last-child { font-variant-numeric: tabular-nums; color: #fff; }
.plf-am-msum {
    border-bottom: none;
    font-weight: 700;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 2px;
}
.plf-am-note {
    margin: 6px 0 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.plf-am-formula {
    font-style: normal;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.38);
}
.plf-am-chips-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plf-am-lifecycle { display: flex; gap: 8px; flex-wrap: wrap; }

/* ⚙ Kostenmodell-Settings */
.plf-set-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.plf-set-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 12px;
    align-items: center;
}
.plf-set-label { display: flex; flex-direction: column; gap: 1px; }
.plf-set-label span:first-child { font-size: 0.82rem; font-weight: 600; color: #fff; }
.plf-set-hint { font-size: 0.7rem; color: rgba(255, 255, 255, 0.45); }
.plf-set-input { text-align: right; }
.plf-set-saved { margin: 8px 0 0; font-size: 0.78rem; color: #34d399; }

@media (max-width: 900px) {
    .plf-am-grid { grid-template-columns: 1fr; }
    .plf-am-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .plf-usage-grid { grid-template-columns: 1fr; }
    .plf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Tenant-Profil: Hintergründe-Pane (Motiv-Zeilen + Schalter) ─────────── */
.plf-tbg { display: flex; flex-direction: column; gap: 6px; }
.plf-tbg-intro { margin: 0 0 6px; font-size: 0.85rem; }
.plf-tbg-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--glass-border-subtle);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
}
.plf-tbg-row:hover { border-color: var(--glass-border); }
.plf-tbg-row.is-everyone { cursor: default; opacity: 0.75; }
.plf-tbg-thumb {
    width: 56px;
    height: 34px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-primary);
    flex: none;
}
.plf-tbg-name {
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ── Tenant-Fenster (ms-win auf /platform/:id) ──────────────────────────── */
.plf-header-inwin { margin-bottom: 14px; }
.plf-tbg-toolbar { margin: 2px 0 10px; }
.plf-tbg-gap { margin-top: 14px; }
.plf-tbg-owned { cursor: default; }
.plf-tbg-owned .abg-mode-select { flex: 0 0 118px; }
/* Verwaltungsfenster IM Analytics-Popup: feste Höhe, ms-win füllt sie. */
.plf-manage-host {
    display: flex;
    height: min(72vh, 780px);
    margin-top: 4px;
    min-height: 0;
}
.plf-manage-host .ms-win { height: 100%; }
/* Nutzer-Tabelle IM Popup: kompakt — „Zuletzt aktiv" + „Top-Funktion" fallen
   weg (die volle Tabelle gibt es auf der Deep-Link-Seite), kein 760px-Zwang
   → kein horizontales Overflow, keine dicke Scrollbar. */
.plf-manage-host .plf-users-row {
    grid-template-columns: minmax(0, 1.6fr) 0.9fr 0.7fr 0.9fr 0.8fr;
    min-width: 0;
}
.plf-manage-host .plf-users-row > :nth-child(5),
.plf-manage-host .plf-users-row > :nth-child(7) { display: none; }
.plf-manage-host .ms-scroll { overflow-x: hidden; }
/* Motiv-Zeilen: Status-Tag + Schalter kompakt, Zeile ist kein Klickziel mehr. */
.plf-tbg-row { cursor: default; }
.plf-tbg-row.is-everyone { opacity: 1; }
.plf-tbg-tag { flex: none; }
.plf-tbg-switch { flex: none; cursor: pointer; }
.plf-tbg-row .abg-mode-select { flex: 0 0 112px; }
/* Lösch-Bestätigung (eigene Box statt window.confirm). */
.plf-confirm { max-width: 420px; }
.plf-confirm-text { color: var(--text-secondary); font-size: 0.9rem; margin: 8px 0 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Profile Widgets — Premium glassmorphism design
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Widget base ──────────────────────────────────────────────────────────── */
.cp-widget {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.cp-widget:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.06);
}

.cp-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cp-widget-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.cp-widget-icon svg {
    width: 15px;
    height: 15px;
    opacity: 0.7;
}
.cp-widget-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.cp-widget-empty {
    text-align: center;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.cp-widget-empty-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 6px;
    opacity: 0.5;
}
.cp-widget-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── Linked contacts (company profile) ────────────────────────────────────── */
.cpw-linked-contact {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.cpw-linked-contact:hover {
    background: var(--surface-hover, rgba(255, 255, 255, 0.05));
}
.cpw-lc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.cpw-lc-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Revenue rollup (company profile) ─────────────────────────────────────── */
.cpw-rollup-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cpw-rollup-cell {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--surface-hover, rgba(255, 255, 255, 0.04));
}
.cpw-rollup-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.cpw-rollup-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.cpw-rollup-won .cpw-rollup-val {
    color: var(--success, #22c55e);
}

/* ── Company hierarchy (parent/child navigation + picker) ─────────────────── */
.cpw-hierarchy-picker {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.cpw-parent-link {
    color: var(--accent, #6366f1);
    text-decoration: none;
}
.cpw-parent-link:hover {
    text-decoration: underline;
}

/* ── Company feed empty-state (right column) ──────────────────────────────── */
.cp-feed-empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Quick-action overflow ("•••") dropdown ──────────────────────────────── */
.cp-action-more { position: relative; }
.cp-action-menu {
    position: absolute;
    top: 112%;
    right: 0;
    z-index: 60;
    min-width: 168px;
    display: none;
    padding: 6px;
    background: var(--surface-raised, #1b2436);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.cp-action-menu.open { display: block; }
.cp-menu-backdrop { position: fixed; inset: 0; z-index: 55; }
.cp-action-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}
.cp-action-menu-item:hover { background: var(--surface-hover, rgba(255, 255, 255, 0.06)); }
.cp-action-menu-item.danger { color: #f87171; }


/* Custom box (tenant-authored free text + links) */
.cpw-custom-body {
    font-size: 13px;
    color: var(--text-secondary, #b6bac9);
    line-height: 1.5;
}

.cpw-custom-link {
    font-size: 13px;
    color: var(--accent, #8b5cf6);
    text-decoration: none;
}

.cpw-custom-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Products Widget — Collapsible Card
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-products-widget { padding: 0 !important; overflow: visible; }

/* Collapsed Header */
.cpw-prod-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; cursor: pointer;
    transition: background 0.15s;
}
.cpw-prod-header:hover { background: rgba(99, 102, 241, 0.04); }
.cpw-prod-header-left {
    display: flex; align-items: center; gap: 8px;
}
.cpw-prod-icon { display: flex; color: #a5b4fc; opacity: 0.7; }
.cpw-prod-icon svg { width: 15px; height: 15px; }
.cpw-prod-title {
    font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
}
.cpw-prod-count {
    font-size: 0.68rem; font-weight: 700;
    padding: 1px 7px; border-radius: 12px;
    background: rgba(99, 102, 241, 0.15); color: #818cf8;
}
.cpw-prod-header-right {
    display: flex; align-items: center; gap: 10px;
}
.cpw-prod-brutto {
    font-size: 0.88rem; font-weight: 700; color: #818cf8;
    font-variant-numeric: tabular-nums;
}
.cpw-prod-chevron {
    display: inline-flex; color: rgba(255,255,255,0.3);
    transition: transform 0.2s ease;
}
.cpw-prod-chevron.open { transform: rotate(180deg); }
.cpw-prod-chevron svg { width: 12px; height: 12px; }

/* Expanded Body */
.cpw-prod-body {
    padding: 0 12px 12px;
    display: flex; flex-direction: column; gap: 4px;
    animation: fieldsFadeIn 0.2s ease;
}

/* Product Row */
.cpw-prod-row {
    padding: 8px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.02);
    transition: background 0.15s;
}
.cpw-prod-row:hover { background: rgba(99, 102, 241, 0.05); }
.cpw-prod-row-top {
    display: flex; align-items: center; gap: 8px;
}
.cpw-prod-row-info { flex: 1; min-width: 0; }
.cpw-prod-row-name {
    font-size: 0.82rem; font-weight: 500; color: var(--text-primary);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cpw-prod-row-cat {
    font-size: 0.65rem; color: var(--text-secondary); opacity: 0.7;
}
.cpw-prod-row-price {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.75rem; color: var(--text-secondary); flex-shrink: 0;
}
.cpw-prod-row-disc {
    color: #22c55e; font-weight: 600; font-size: 0.68rem;
}
.cpw-prod-row-rm {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; opacity: 0; transition: opacity 0.15s, color 0.15s;
    display: flex; align-items: center; padding: 2px;
}
.cpw-prod-row:hover .cpw-prod-row-rm { opacity: 1; }
.cpw-prod-row-rm:hover { color: #ef4444; }
.cpw-prod-row-rm svg { width: 14px; height: 14px; }

/* Per-row detail: Netto / MwSt / Brutto */
.cpw-prod-row-detail {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 0 0 0;
    font-size: 0.68rem; color: var(--text-secondary);
}
.cpw-prod-row-netto { opacity: 0.6; }
.cpw-prod-row-tax { opacity: 0.5; }
.cpw-prod-row-brutto {
    margin-left: auto; font-weight: 700; color: var(--text-primary);
    font-size: 0.75rem;
}
.cpw-prod-row-model {
    font-size: 0.6rem; font-weight: 400; color: var(--text-secondary); margin-left: 2px;
}

/* Totals Footer */
.cpw-prod-totals {
    margin-top: 6px; padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 3px;
}
.cpw-prod-total-row {
    display: flex; justify-content: space-between;
    font-size: 0.75rem; color: var(--text-secondary);
}
.cpw-prod-total-tax { opacity: 0.6; }
.cpw-prod-total-brutto {
    font-weight: 700; color: #818cf8; font-size: 0.85rem;
    padding-top: 4px; margin-top: 2px;
    border-top: 1px solid rgba(99,102,241,0.15);
}

/* Add Button */
.cpw-prod-add-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 8px; margin-top: 6px;
    font-size: 0.78rem; font-weight: 600;
    background: rgba(99,102,241,0.06); color: #a5b4fc;
    border: 1px dashed rgba(99,102,241,0.2); border-radius: 8px;
    cursor: pointer; transition: all 0.15s;
}
.cpw-prod-add-btn:hover {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.35);
}
.cpw-prod-add-btn svg { width: 14px; height: 14px; }

/* ── Add-Product Popup (draggable, same pattern as widget palette) ── */
.cpw-add-popup {
    /* Position (left/top) is set inline; portalled to <body>, anchored beside
       the left column. High z-index so it sits above the notes composer. */
    position: fixed; left: 420px; top: 90px;
    width: 320px; max-height: 480px;
    background: rgba(15, 18, 40, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 20px rgba(99,102,241,0.08);
    z-index: 4100;
    display: flex; flex-direction: column;
    /* Own entrance keyframe — the shared editModalIn uses translate(-50%,-50%)
       for CENTERED modals, which would offset this left/top-anchored popup and
       make it fly in from the corner. */
    animation: cpwAddPopupIn 0.18s cubic-bezier(0.2, 0, 0.13, 1);
    overflow: hidden;
}
@keyframes cpwAddPopupIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
.cpw-add-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cpw-add-popup-header h3 {
    margin: 0; font-size: 0.9rem; font-weight: 700; color: #fff;
}

/* Search */
.cpw-add-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cpw-add-search-icon { display: flex; color: rgba(255,255,255,0.3); flex-shrink: 0; }
.cpw-add-search-icon svg { width: 14px; height: 14px; }
.cpw-add-search-input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 0.82rem; color: #fff;
}
.cpw-add-search-input::placeholder { color: rgba(255,255,255,0.25); }

/* Quantity */
.cpw-add-qty-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cpw-add-qty-label { font-size: 0.78rem; color: rgba(255,255,255,0.5); flex: 1; }
.cpw-add-qty-btn {
    width: 24px; height: 24px; border-radius: 6px;
    background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.2);
    color: #a5b4fc; cursor: pointer; font-size: 0.9rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.cpw-add-qty-btn:hover { background: rgba(99,102,241,0.25); }
.cpw-add-qty-val {
    font-size: 0.88rem; font-weight: 700; color: #fff;
    min-width: 20px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.cpw-add-disc-input {
    width: 72px; text-align: right;
    background: rgba(0,0,0,0.25); color: #fff;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    padding: 5px 9px; font: inherit; font-size: 0.82rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.cpw-add-disc-input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
}

/* Catalog List */
.cpw-add-list {
    flex: 1; overflow-y: auto; padding: 4px 8px 8px;
    max-height: 280px;
    scrollbar-width: thin;
}
.cpw-add-empty {
    text-align: center; padding: 20px; color: rgba(255,255,255,0.3);
    font-size: 0.8rem; font-style: italic;
}
.cpw-add-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: all 0.15s;
    margin-bottom: 2px;
}
.cpw-add-item:hover {
    background: rgba(99, 102, 241, 0.08);
}
.cpw-add-item-info { flex: 1; min-width: 0; }
.cpw-add-item-name {
    font-size: 0.82rem; font-weight: 500; color: #fff;
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cpw-add-item-cat {
    font-size: 0.62rem; color: rgba(255,255,255,0.35);
}
.cpw-add-item-price {
    display: flex; flex-direction: column; align-items: flex-end;
    flex-shrink: 0;
}
.cpw-add-item-brutto {
    font-size: 0.78rem; font-weight: 700; color: #818cf8;
}
.cpw-add-item-netto {
    font-size: 0.62rem; color: rgba(255,255,255,0.3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Scoring Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-score-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.cpw-score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 10px;
}
.cpw-score-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cpw-score-max {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}
.cpw-score-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}
.cpw-score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.cpw-score-rules {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.cpw-score-rules-title {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.cpw-rule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}
.cpw-rule-name {
    font-size: 0.75rem;
    color: var(--text-primary);
}
.cpw-rule-pos {
    font-size: 0.72rem;
    font-weight: 700;
    color: #22c55e;
}
.cpw-rule-neg {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Invoices Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-inv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.cpw-inv-row:hover { background: rgba(255, 255, 255, 0.03); }

.cpw-inv-nr {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 500;
}
.cpw-inv-amount {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.cpw-inv-status {
    font-size: 0.64rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}
.cpw-inv-paid {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}
.cpw-inv-open {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.cpw-inv-overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.cpw-inv-draft {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.cpw-inv-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.cpw-inv-footer-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 2px 0;
}
.cpw-inv-footer-val {
    font-weight: 700;
    color: var(--text-primary);
}
.cpw-inv-open-row { color: #f59e0b; }
.cpw-inv-open-val { color: #f59e0b !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   Tags Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.cpw-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: default;
}
.cpw-tag-chip:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.cpw-tag-remove {
    background: none;
    border: none;
    color: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.4;
    padding: 0;
    line-height: 1;
    transition: opacity 0.15s;
}
.cpw-tag-remove:hover { opacity: 1; }

.cpw-tag-input {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: var(--text-primary);
    outline: none;
    width: 80px;
    transition: border-color 0.2s, width 0.2s;
}
.cpw-tag-input:focus {
    border-color: #818cf8;
    width: 120px;
}
.cpw-tag-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Quick Actions Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.cpw-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}
.cpw-action-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}
.cpw-action-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}
.cpw-action-email:hover { border-color: rgba(59, 130, 246, 0.4); }
.cpw-action-email:hover svg { color: #3b82f6; }
.cpw-action-call:hover { border-color: rgba(34, 197, 94, 0.4); }
.cpw-action-call:hover svg { color: #22c55e; }
.cpw-action-meeting:hover { border-color: rgba(139, 92, 246, 0.4); }
.cpw-action-meeting:hover svg { color: #8b5cf6; }
.cpw-action-gdpr:hover { border-color: rgba(245, 158, 11, 0.4); }
.cpw-action-gdpr:hover svg { color: #f59e0b; }

/* ═══════════════════════════════════════════════════════════════════════════
   Deals Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-deal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.cpw-deal-row:hover { background: rgba(255, 255, 255, 0.03); }
.cpw-deal-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.cpw-deal-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cpw-deal-stage {
    font-size: 0.68rem;
    font-weight: 600;
}
.cpw-deal-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.cpw-deal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.cpw-deal-footer-val {
    font-weight: 700;
    color: #818cf8;
    font-size: 0.85rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Activities Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-activity-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
}
.cpw-activity-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.cpw-activity-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cpw-activity-action {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
}
.cpw-activity-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cpw-activity-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.7;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Notes Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-note-row {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}
.cpw-note-row:hover { background: rgba(255, 255, 255, 0.04); }
.cpw-note-content {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
}
.cpw-note-meta {
    display: flex;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.7;
}
.cpw-note-author {
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Company Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-company-card {
    padding: 4px 0;
}
.cpw-company-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.cpw-company-industry {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.cpw-company-link {
    font-size: 0.72rem;
    color: #818cf8;
    text-decoration: none;
    transition: color 0.15s;
}
.cpw-company-link:hover { color: #a5b4fc; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   Contact Info Widget
   ═══════════════════════════════════════════════════════════════════════════ */
.cpw-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.cpw-info-row:last-child { border-bottom: none; }
.cpw-info-icon {
    display: flex;
    color: var(--text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}
.cpw-info-icon svg { width: 14px; height: 14px; }
.cpw-info-val {
    font-size: 0.78rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    word-break: break-all;
}
.cpw-info-link {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.15s;
}
.cpw-info-link:hover { color: #a5b4fc; text-decoration: underline; }
.cpw-info-muted {
    color: var(--text-secondary) !important;
    font-size: 0.72rem !important;
}
.cpw-info-status {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.cpw-info-status-customer {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}
.cpw-info-status-qualified {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}
.cpw-info-status-lead {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.cpw-info-status-churned {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sales Owner Widget (so-)
   ═══════════════════════════════════════════════════════════════════════════ */
.so-widget {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: 12px 14px;
    transition: border-color 0.2s;
}
.so-widget:hover { border-color: rgba(99,102,241,0.2); }

.so-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.so-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
}
.so-edit-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); padding: 2px; display: flex;
    opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.so-widget:hover .so-edit-btn { opacity: 0.6; }
.so-edit-btn:hover { opacity: 1 !important; color: var(--accent); }

/* ── Owner Display ─────────────────────────────────────────── */
.so-owner-row {
    display: flex; align-items: center; gap: 10px;
}
.so-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: white;
    flex-shrink: 0; text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.so-avatar-sm {
    width: 28px; height: 28px; font-size: 0.65rem;
}
.so-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.so-name {
    font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.so-team {
    font-size: 0.68rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.so-remove-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); padding: 4px; display: flex;
    opacity: 0; transition: all 0.15s;
}
.so-owner-row:hover .so-remove-btn { opacity: 0.5; }
.so-remove-btn:hover { opacity: 1 !important; color: #f87171; }

/* Owner + Team two-row layout */
.so-display { display: flex; flex-direction: column; gap: 8px; }
.so-role {
    font-size: 0.65rem; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.so-team-row {
    display: flex; align-items: center; gap: 8px;
    padding-left: 2px;
}
.so-team-name {
    font-size: 0.78rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Empty State ───────────────────────────────────────────── */
.so-empty {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; cursor: pointer;
    color: var(--text-muted); transition: color 0.15s;
}
.so-empty:hover { color: var(--accent); }
.so-empty-icon { display: flex; opacity: 0.5; }
.so-empty-text { font-size: 0.78rem; }

/* ── Dropdown ──────────────────────────────────────────────── */
.so-dropdown {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    animation: so-slide-in 0.2s ease-out;
}
@keyframes so-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.so-search {
    width: 100%; padding: 7px 10px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 8px; color: var(--text-primary);
    font-size: 0.78rem; outline: none;
    margin-bottom: 8px; transition: border-color 0.15s;
}
.so-search:focus { border-color: var(--accent); }
.so-search::placeholder { color: var(--text-muted); }

.so-user-list {
    max-height: 180px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.so-user-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 6px 8px; border-radius: 8px;
    background: transparent; border: none; cursor: pointer;
    text-align: left; transition: background 0.12s;
}
.so-user-item:hover { background: rgba(99,102,241,0.1); }
.so-user-meta {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0;
}
.so-user-name {
    font-size: 0.78rem; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.so-user-team {
    font-size: 0.65rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.so-loading {
    padding: 12px; text-align: center;
    font-size: 0.75rem; color: var(--text-muted);
}
.so-close-btn {
    width: 100%; margin-top: 6px; padding: 5px;
    background: transparent; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; color: var(--text-muted);
    font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
}
.so-close-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.12); }

/* ══════════════════════════════════════════════════════════════
   Call Fullscreen — VoIP Dialer with customizable widget grid
   ══════════════════════════════════════════════════════════════ */

/* ── Overlay Container ──────────────────────────────────────── */
.cfs-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgb(0, 17, 32);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* ── Top Bar ────────────────────────────────────────────────── */
.cfs-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    background: rgba(67, 77, 123, 0.25);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.cfs-topbar-name {
    font-size: 1.1rem; font-weight: 600; color: #fff;
    letter-spacing: 0.01em;
}
.cfs-minimize-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #94a3b8);
    text-decoration: none; cursor: pointer;
    transition: all 0.2s ease;
}
.cfs-minimize-btn:hover {
    background: rgba(99,102,241,0.15); color: #fff;
    border-color: rgba(99,102,241,0.3);
}

/* ── Loading ────────────────────────────────────────────────── */
.cfs-loading {
    flex: 1; display: flex; align-items: center; justify-content: center;
}

/* ── Empty State ────────────────────────────────────────────── */
.cfs-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-muted, #64748b); gap: 8px;
}
.cfs-empty-sub { font-size: 0.8rem; opacity: 0.6; }

/* ── Widget Grid ────────────────────────────────────────────── */
.cfs-grid {
    flex: 1; display: grid;
    gap: 16px; padding: 16px 20px;
    min-height: 0;
}

/* ── Widget Card ────────────────────────────────────────────── */
.cfs-widget {
    background: rgba(67, 77, 123, 0.30);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.cfs-widget:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.cfs-widget-header {
    padding: 12px 16px 0;
    flex-shrink: 0;
}
.cfs-widget-title {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(255,255,255,0.4);
}
.cfs-widget-body {
    flex: 1; padding: 8px 16px 16px;
    overflow: auto; min-height: 0;
}

/* ── Contact Card Widget ────────────────────────────────────── */
.cfs-contact-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding-top: 8px;
}
.cfs-cc-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.3));
    border: 2px solid rgba(99,102,241,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff;
    letter-spacing: 0.02em;
}
.cfs-cc-name {
    font-size: 1.3rem; font-weight: 600; color: #fff;
    text-align: center;
}
.cfs-cc-fields {
    width: 100%; display: flex; flex-direction: column; gap: 6px;
    margin-top: 8px;
}
.cfs-cc-field {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
}
.cfs-cc-field-label {
    font-size: 0.75rem; color: rgba(255,255,255,0.4);
    font-weight: 500;
}
.cfs-cc-field-value {
    font-size: 0.8rem; color: #fff; font-weight: 500;
}

/* ── Notes Widget ───────────────────────────────────────────── */
.cfs-notes {
    display: flex; flex-direction: column; height: 100%;
}
.cfs-notes-feed {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
    gap: 6px; padding-bottom: 8px;
}
.cfs-note-entry {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 6px 10px;
    background: rgba(0,0,0,0.12); border-radius: 8px;
}
.cfs-note-ts {
    font-size: 0.65rem; color: rgba(99,102,241,0.7);
    font-weight: 600; min-width: 36px; padding-top: 2px;
}
.cfs-note-text {
    font-size: 0.8rem; color: rgba(255,255,255,0.85);
    line-height: 1.4; word-break: break-word;
}
.cfs-notes-input {
    display: flex; gap: 8px; align-items: flex-end;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 8px;
}
.cfs-notes-textarea {
    flex: 1; resize: none;
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 8px 12px;
    color: #fff; font-size: 0.8rem;
    font-family: inherit; line-height: 1.4;
    outline: none; transition: border-color 0.2s;
}
.cfs-notes-textarea:focus {
    border-color: rgba(99,102,241,0.4);
}
.cfs-notes-textarea::placeholder { color: rgba(255,255,255,0.2); }
.cfs-notes-send {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(99,102,241,0.2); border: 1px solid rgba(99,102,241,0.3);
    color: rgba(99,102,241,0.8); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.cfs-notes-send:hover {
    background: rgba(99,102,241,0.35); color: #fff;
}


/* ── Quickactions Widget ────────────────────────────────────── */
.cfs-qa { height: 100%; display: flex; flex-direction: column; }

.cfs-qa-grid {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
    gap: 10px; flex: 1;
}
.cfs-qa-btn {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 8px;
    background: rgba(67, 77, 123, 0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    color: #fff; cursor: pointer;
    font-size: 0.75rem; font-weight: 500;
    transition: all 0.2s ease;
}
.cfs-qa-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-1px);
}
.cfs-qa-btn svg { opacity: 0.7; }
.cfs-qa-btn:hover svg { opacity: 1; }

.cfs-qa-btn-soon {
    opacity: 0.35; cursor: default;
}
.cfs-qa-btn-soon:hover {
    background: rgba(67, 77, 123, 0.4);
    border-color: rgba(255,255,255,0.06);
    transform: none;
}

/* Expanded state */
.cfs-qa-expanded {
    display: flex; flex-direction: column; height: 100%;
}
.cfs-qa-back {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; margin-bottom: 8px;
    background: rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; color: rgba(255,255,255,0.6);
    font-size: 0.75rem; cursor: pointer;
    transition: all 0.2s; width: fit-content;
}
.cfs-qa-back:hover { color: #fff; background: rgba(99,102,241,0.15); }
.cfs-qa-content { flex: 1; overflow-y: auto; }

.cfs-qa-profile-fields {
    display: flex; flex-direction: column; gap: 8px;
}
.cfs-qa-field {
    display: flex; flex-direction: column; gap: 4px;
}
.cfs-qa-field-label {
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.35);
}
.cfs-qa-field-input {
    padding: 8px 12px; border-radius: 8px;
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
    color: #fff; font-size: 0.8rem;
    outline: none; transition: border-color 0.2s;
}
.cfs-qa-field-input:focus {
    border-color: rgba(99,102,241,0.4);
}

/* ── Bottom Bar Widget ──────────────────────────────────────── */
.cfs-bottombar {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 8px;
}
.cfs-bb-controls {
    display: flex; align-items: center; gap: 12px;
}
.cfs-bb-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 50px;
    font-size: 0.8rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: all 0.2s ease;
}
.cfs-bb-call {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.cfs-bb-call:hover {
    box-shadow: 0 6px 24px rgba(16,185,129,0.5);
    transform: translateY(-1px);
}
.cfs-bb-hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff; box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}
.cfs-bb-hangup:hover {
    box-shadow: 0 6px 24px rgba(239,68,68,0.5);
    transform: translateY(-1px);
}
.cfs-bb-retry {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.cfs-bb-retry:hover {
    box-shadow: 0 6px 24px rgba(59,130,246,0.5);
}
.cfs-bb-mute, .cfs-bb-hold {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.5);
    padding: 8px 14px; border-radius: 50px;
}
.cfs-bb-mute:hover, .cfs-bb-hold:hover {
    background: rgba(255,255,255,0.1); color: #fff;
}
.cfs-bb-mute.active, .cfs-bb-hold.active {
    background: rgba(239,68,68,0.15); color: #ef4444;
    border-color: rgba(239,68,68,0.3) !important;
}
.cfs-bb-timer {
    font-size: 1.3rem; font-weight: 700; color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}
.cfs-bb-ended {
    font-size: 0.9rem; color: rgba(255,255,255,0.5);
    font-weight: 500;
}
.cfs-bb-ringing {
    display: flex; align-items: center; gap: 8px;
    color: rgba(16,185,129,0.8); font-size: 0.85rem; font-weight: 500;
}
.cfs-bb-ring-pulse {
    width: 10px; height: 10px; border-radius: 50%;
    background: #10b981;
    animation: cfs-pulse 1.2s ease-in-out infinite;
}

/* ── Audio Waveform ─────────────────────────────────────────── */
.cfs-bb-waveform {
    flex: 0 0 260px; height: 60px;
}
.cfs-waveform-svg {
    width: 100%; height: 100%;
}
.cfs-wf-bar {
    fill: rgba(255,255,255,0.08);
    transition: all 0.15s ease;
}
.cfs-wf-bar.active {
    fill: rgba(99,102,241,0.6);
    animation: cfs-wave 0.8s ease-in-out infinite alternate;
}

/* ── Placeholder (future widgets) ───────────────────────────── */
.cfs-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 8px; height: 100%;
    color: rgba(255,255,255,0.2);
}
.cfs-placeholder-icon { font-size: 2rem; }
.cfs-placeholder-text { font-size: 0.75rem; font-weight: 500; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes cfs-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.3; }
}

@keyframes cfs-wave {
    0% {
        height: 4px; y: 28;
    }
    100% {
        height: 40px; y: 10;
    }
}

/* Admin panel, custom fields, roles, templates */

/* Card */
.admin-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: var(--space-md);
}
.admin-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-sm); padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
}
.admin-card-header h3 { margin: 0; font-size: 1rem; color: var(--text-primary); }
.admin-card-actions { display: flex; gap: var(--space-xs); }

/* Fields list */
.admin-fields-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.admin-field-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0,0,0,0.15); border-radius: var(--radius-sm);
}
.admin-field-main {
    display: flex; align-items: center; gap: var(--space-xs); width: 100%;
}
.admin-field-sort {
    display: flex; flex-direction: column; gap: 1px; flex-shrink: 0;
}
.admin-field-sort .btn-icon { font-size: 0.65rem; width: 20px; height: 14px; }
.admin-field-sort .btn-icon:disabled { opacity: 0.2; cursor: default; }
.admin-field-info { display: flex; gap: var(--space-sm); align-items: center; flex: 1; min-width: 0; }
.admin-field-name { font-size: 0.875rem; color: var(--text-primary); }
.admin-field-details {
    display: flex; gap: var(--space-sm); padding-left: 28px;
}
.admin-detail-tag {
    font-size: 0.65rem; color: var(--text-muted); font-style: italic;
}

/* Inline editing */
.admin-editable { cursor: pointer; }
.admin-editable:hover { color: var(--accent); }
.admin-inline-edit { display: flex; gap: var(--space-xs); align-items: center; }
.admin-inline-input {
    border-color: var(--accent) !important; background: rgba(0,0,0,0.3) !important;
}
.admin-field-type {
    font-size: 0.7rem; color: var(--accent); text-transform: uppercase;
    padding: 2px 6px; background: rgba(99,102,241,0.15); border-radius: var(--radius-sm);
}

/* Display flag toggles */
.admin-field-flags { display: flex; gap: 4px; align-items: center; }
.admin-flag {
    font-size: 0.6rem; padding: 2px 6px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer; font-weight: 600;
    text-transform: uppercase; transition: all var(--transition-fast);
}
.admin-flag-on {
    background: rgba(52, 211, 153, 0.15); color: #34d399; border-color: rgba(52, 211, 153, 0.3);
}
.admin-flag-on:hover { background: rgba(52, 211, 153, 0.25); }
.admin-flag-off {
    background: rgba(255,255,255,0.04); color: var(--text-muted); border-color: rgba(255,255,255,0.08);
}
.admin-flag-off:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.admin-field-badge {
    font-size: 0.65rem; padding: 2px 5px; border-radius: var(--radius-sm);
    text-transform: uppercase; font-weight: 600;
}
.admin-badge-required {
    background: rgba(248, 113, 113, 0.15); color: #f87171;
}
.admin-field-tech {
    font-size: 0.65rem; color: var(--text-muted); font-family: monospace;
    padding: 1px 4px; background: rgba(255,255,255,0.05); border-radius: 3px;
}

/* Add field form */
.admin-add-field-form {
    margin-top: var(--space-sm); padding-top: var(--space-sm);
    border-top: 1px solid var(--glass-border);
}
.admin-field-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}
.admin-checkbox-label {
    display: flex; align-items: center; gap: var(--space-xs);
    font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
}
.admin-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Inputs */
.admin-input {
    flex: 1; padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.875rem; outline: none;
}
.admin-input:focus { border-color: var(--accent); }
.admin-input-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.8rem; }
.admin-select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.8rem; outline: none;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none;
    transition: all var(--transition-fast);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.8rem; }
.btn svg { width: 16px; height: 16px; }

.btn-icon {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon-sm { width: 28px; height: 28px; }
.btn-icon-sm svg { width: 14px; height: 14px; }
.btn-icon-xs { width: 24px; height: 24px; }
.btn-icon-xs svg { width: 12px; height: 12px; }
.btn-danger:hover { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* Form rows */
.admin-form-row { display: flex; gap: var(--space-sm); align-items: center; }

/* Empty state */
.admin-empty { font-size: 0.8rem; margin-top: var(--space-xs); }
.admin-empty-state {
    text-align: center; padding: var(--space-xl) * 2;
    color: var(--text-muted);
}
.admin-empty-state svg { width: 48px; height: 48px; stroke: var(--text-muted); margin-bottom: var(--space-md); }
.admin-empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-xs); }

.admin-loading { color: var(--text-muted); padding: var(--space-lg); text-align: center; }

/* ── Admin Table ── */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table thead { background: rgba(0,0,0,0.3); }
.admin-table th { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.admin-table tr:hover { background: rgba(255,255,255,0.02); }
.admin-row-inactive { opacity: 0.5; }

/* Status badges */
.admin-status-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.admin-status-active { background: rgba(52,211,153,0.15); color: var(--success); }
.admin-status-active:hover { background: rgba(52,211,153,0.25); }
.admin-status-inactive { background: rgba(248,113,113,0.15); color: var(--danger); }
.admin-status-inactive:hover { background: rgba(248,113,113,0.25); }

/* 2FA-on indicator — shield glyph + label (design: twofa-on) */
.twofa-on { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 0.8rem; font-weight: 600; }
.twofa-on svg { width: 15px; height: 15px; }

/* Row action icon button (Aktionen column pencil) */
.admin-icon-btn { width: 30px; height: 30px; border-radius: var(--radius-sm); background: none; border: 1px solid transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-fast); }
.admin-icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--glass-border); }
.admin-icon-btn svg { width: 15px; height: 15px; }

/* User form grid */
.admin-user-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.admin-form-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Smaller select */
.admin-select-sm { padding: 4px 8px; font-size: 0.8rem; min-width: 100px; }


/* ── Rescue ─────────────────────────────────────────────────── */
.rescue-empty {
    color: var(--text-muted); font-size: 0.8125rem;
    text-align: center; padding: var(--space-md) !important;
}

/* ── Admin → Start (overview) content ────────────────────────────────────────
   Fixed layout per the Start-panel design: page header, three KPI tiles
   (staggered entrance + hover-lift), the recent-events feed (tinted icon
   chips, expandable), the 14-day login bar chart and the system-status card.
   Quick actions / roles panel / drag-reorder edit mode were removed with the
   redesign — every area has its own sidebar section now. */

.aa-tab {
    min-width: 0;
}
.aa-main {
    min-width: 0;
}
.aa-head {
    position: relative;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
/* Heading matched to the deployed pages' `.page-header`/`.page-title`/
   `.page-subtitle` (h1 = 1.75rem/700) so the admin Start reads like the rest
   of the app. */
.aa-head h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-primary);
}
.aa-head p {
    margin: var(--space-xs) 0 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

/* ── KPI tiles ──────────────────────────────────────────────────────────── */
.aa-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: var(--space-md);
}
.aa-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    /* Lit-from-above resting state + smooth hover-lift (design-system motion). */
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: transform var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
    /* Staggered entrance — backwards fill keeps the pre-delay state visible. */
    animation: aa-card-enter 0.5s var(--ease-standard) backwards;
}
.aa-kpi:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}
@keyframes aa-card-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.aa-kpi:nth-child(1) {
    animation-delay: 0ms;
}
.aa-kpi:nth-child(2) {
    animation-delay: 60ms;
}
.aa-kpi:nth-child(3) {
    animation-delay: 120ms;
}
.aa-kpi-label {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 15px;
}
.aa-kpi-num {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.04;
    color: var(--text-primary);
}
.aa-kpi-sub {
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Start grid: events left, chart + status right ──────────────────────── */
/* Status header: title left, badge right on one line (saves height so the
   card can end level with the collapsed events card). */
.aa-sys-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.aa-sys-head h3 {
    margin: 0;
}

/* The (collapsed) events card defines the row height; the right column does
   NOT contribute to it (height:0 + min-height:100%) and stretches to match,
   with the status card flexing to end exactly on the events card's bottom. */
.aa-start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    align-items: stretch;
}
.aa-start-side {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-width: 0;
    height: 0;
    min-height: 100%;
}
/* Side cards run compact so both together end level with the events card. */
.aa-start-side .aa-panel {
    padding: 18px var(--space-lg);
}
.aa-start-side .aa-panel h3 {
    font-size: 16px;
    margin-bottom: 8px;
}
.aa-sys-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* Never cut rows silently — if space runs out the list scrolls. */
.aa-sys-panel .aa-sys-list {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}
.aa-panel {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}
/* Room for the centered expand chevron under the list. */
.aa-events-panel {
    padding-bottom: 42px;
}
.aa-panel-toggle {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    transition: color var(--transition-fast), transform 0.2s ease;
}
.aa-panel-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}
.aa-panel-toggle.is-open {
    transform: translateX(-50%) rotate(180deg);
}
.aa-panel h3 {
    margin: 0 0 var(--space-md);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.aa-panel-sub {
    margin: -6px 0 10px;
    color: var(--text-muted);
    font-size: 12px;
}
.aa-empty {
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Events feed — tinted icon chip · title/meta · time right ───────────── */
/* The list scrolls in BOTH states; collapsed shows exactly five rows
   (5 × 70px row pitch incl. divider — keep in sync with .aa-event metrics),
   the chevron doubles the window and it keeps scrolling. */
.aa-events {
    list-style: none;
    margin: 0;
    padding: 0 6px 0 0;
    display: flex;
    flex-direction: column;
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
    transition: max-height 0.25s var(--ease-standard);
}
.aa-events.is-expanded {
    max-height: 700px;
}
.aa-events::-webkit-scrollbar {
    width: 5px;
}
.aa-events::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover);
    border-radius: 3px;
}
.aa-event {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
}
.aa-event + .aa-event {
    border-top: 1px solid var(--glass-border);
}
.aa-ev-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--info);
    color: var(--info);
    background: rgba(96, 165, 250, 0.08);
}
.aa-ev-ico svg {
    width: 16px;
    height: 16px;
}
.aa-ev-ico.is-green {
    border-color: var(--success);
    color: var(--success);
    background: rgba(52, 211, 153, 0.08);
}
.aa-ev-ico.is-violet {
    border-color: #a78bfa;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
}
.aa-ev-ico.is-amber {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(251, 191, 36, 0.08);
}
.aa-ev-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.aa-ev-title {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}
.aa-ev-meta {
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aa-ev-when {
    margin-left: auto;
    flex: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    padding-top: 2px;
}

/* ── Login bar chart (14 days) ──────────────────────────────────────────── */
.aa-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 56px;
}
.aa-bar {
    flex: 1;
    min-width: 0;
    border-radius: 4px 4px 2px 2px;
    background: var(--accent);
    opacity: 0.75;
    transition: opacity var(--transition-fast);
}
.aa-bar:hover {
    opacity: 1;
}
.aa-bar.is-zero {
    height: 4px !important;
    background: var(--glass-border-hover);
    opacity: 1;
}
.aa-bar.is-latest {
    background: var(--accent-gradient);
    opacity: 1;
    box-shadow: 0 0 12px var(--accent-glow);
}
.aa-chart-x {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ── System status ──────────────────────────────────────────────────────── */
.aa-sys-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}
.aa-sys-badge.is-down {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
}
.aa-sys-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.aa-sys-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.aa-sys-row + .aa-sys-row {
    border-top: 1px solid var(--glass-border);
}
.aa-sys-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    flex: none;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}
.aa-sys-dot.is-down {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}
.aa-sys-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.aa-sys-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}
.aa-sys-sub {
    color: var(--text-muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aa-sys-pct {
    margin-left: auto;
    flex: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.aa-sys-foot {
    margin: 10px 2px 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.aa-loading {
    color: var(--text-secondary);
    padding: var(--space-lg);
}

@media (max-width: 1100px) {
    .aa-start-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Admin Settings Page ────────────────────────────────────────────────────
   macOS-System-Settings-style admin that the global-sidebar shield opens as a
   full page at `/admin`, rendered inside the global `AppLayout` shell (slim
   global sidebar + top bar). Replaces the old `.aa-side` admin rail: every former
   admin surface is a selectable section in the page's own sidebar; Dashboard is
   the landing. Ported from the design skill `ui_kits/admin/admin-settings.html`.
   Canvas sections (Benutzer→Organigramm, Automation) auto-collapse the sidebar
   to an icon rail for more room.                                              */

/* ── Page shell ───────────────────────────────────────────────────────────────
   The admin renders as a full page filling the global `.app-main`. Neutralise the
   main area's padding + scroll so the window sits flush against the global sidebar
   and manages its own internal scrolling / canvas fill. */
.app-main:has(> .ms-win) {
    /* Keep the standard content gutter (`.app-main` padding, same as every
       deployed page) so the admin panel sits inset from the global sidebar + top
       bar. The panel scrolls internally, so hide overflow and drop the reserved
       scrollbar gutter (which would otherwise make the inset asymmetric). */
    overflow: hidden;
    scrollbar-gutter: auto;
    display: flex;
}
.ms-win {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    /* Own containing block for position:fixed children (widget palette, slide-out
       panels) so they anchor to the window instead of jumping to the viewport
       edge. Must be preserved — the canvas editors depend on it. */
    transform: translateZ(0);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.ms-side {
    width: 256px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(22, 30, 54, 0.66), rgba(14, 20, 38, 0.66));
    border-right: 1px solid var(--glass-border);
    transition: width var(--transition-normal);
    padding-top: 14px;
}
.ms-win.collapsed .ms-side { width: 80px; }

.ms-account {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 4px 12px 10px;
    padding: 8px;
    border-radius: 10px;
}
.ms-acc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}
.ms-acc-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ms-acc-name {
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-acc-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-search {
    margin: 0 14px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    background: rgba(8, 12, 22, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}
.ms-search span { display: inline-flex; flex-shrink: 0; color: var(--text-muted); }
.ms-search svg { width: 14px; height: 14px; }
.ms-search input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.84rem;
}
.ms-search input::placeholder { color: var(--text-muted); }

.ms-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 14px; }
.ms-navgroup { margin-top: 14px; }
.ms-navgroup:first-child { margin-top: 2px; }
.ms-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 1px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    text-align: left;
    white-space: nowrap;
    transition: background var(--transition-fast);
}
.ms-item:hover { background: rgba(255, 255, 255, 0.055); }
.ms-item.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4); }
/* Active row: the muted glyph brightens to full (white on the accent pill). */
.ms-item.is-active .ms-tile { opacity: 1; }
/* Muted, sidebar-style glyphs — same icons, no coloured tile (matches .nav-icon).
   The markup's ic-* tint classes are deliberately NOT styled: the admin
   redesign keeps the window sidebar monochrome. */
.ms-tile {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.62;
    transition: opacity var(--transition-fast);
}
.ms-item:hover .ms-tile { opacity: 1; }
.ms-tile svg { width: 16px; height: 16px; }
.ms-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; opacity: 1; transition: opacity 0.18s ease; }


/* Collapsed state — a narrow icon rail. CRUCIAL: collapsing must NOT move or
   resize anything. It ONLY hides the text (labels + account text), hides the
   search input, and narrows the panel. We deliberately do NOT touch the
   margin / padding / justify-content / gap of .ms-account, .ms-search, .ms-nav,
   .ms-navgroup or .ms-item — so the avatar, search icon and nav icons keep the
   exact same x AND y position (and size) as in the expanded rail. */
.ms-win.collapsed .ms-item-label,
.ms-win.collapsed .ms-acc-text { opacity: 0; width: 0; flex: 0; overflow: hidden; }
.ms-win.collapsed .ms-search input { display: none; }
/* The collapsed search + rail act as an expand button. Keep the border as a
   TRANSPARENT 1px (not `none`) so the row height is identical to expanded and the
   nav icons below don't shift up by the border width. */
.ms-win.collapsed .ms-search { background: none; border-color: transparent; cursor: pointer; }
.ms-win.collapsed .ms-nav { cursor: pointer; }
.ms-win.collapsed .ms-item { cursor: pointer; }

/* ── Content ──────────────────────────────────────────────────────────────── */
.ms-content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-secondary); }
/* Sidebar collapse toggle — moved into the sidebar account header (the old
   content toolbar with its title/×/toggle is gone; each section now renders its
   own deployed-style page header at the top-left of the content). */
.ms-acc-toggle {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}
.ms-acc-toggle:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--glass-border); }
.ms-acc-toggle svg { width: 17px; height: 17px; }
.ms-win.collapsed .ms-acc-toggle { display: none; }

/* Benutzer section switcher — a slim tab bar at the top of the content
   (above the page header), switching the list ↔ org-chart views. */
.ms-segbar { display: flex; margin-bottom: var(--space-lg); }
.ms-scroll.is-fill > .ms-segbar,
.ms-scroll.is-fill > .page-header { flex-shrink: 0; }

/* Segmented tabs (Benutzerliste ↔ Organigramm) */
.ms-segtabs { display: inline-flex; background: var(--bg-input); border: 1px solid var(--glass-border); border-radius: 8px; padding: 2px; gap: 2px; }
.ms-seg {
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ms-seg.on { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4); }
.ms-seg:not(.on):hover { color: var(--text-primary); }

/* Scroll area — existing section components render here. Light/settings
   sections get breathing room and scroll. */
.ms-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px 36px; }

/* Full-bleed sections (heavy canvas editors, org-chart, user list) fill the
   content area instead of scrolling. Re-establish the flex chain here and
   override their hard-coded `calc(100vh …)` heights — inside `.ms-content` (which
   sits below the global top bar, so it's shorter than 100vh) those would overflow,
   so pin them to 100% of the content area instead. */
.ms-scroll.is-fill { padding: 24px 28px 28px; overflow: hidden; display: flex; flex-direction: column; }
.ms-scroll.is-fill > .admin-detail-page,
.ms-scroll.is-fill > .admin-detail-page > .admin-detail-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 0;
}
.ms-scroll.is-fill .pc-editor,
.ms-scroll.is-fill .skc-editor,
.ms-scroll.is-fill .org-fullbleed,
.ms-scroll.is-fill .cge-root {
    height: 100% !important;
    max-height: 100% !important;
}
/* Benutzer views (list + org chart) float panel-less on the window surface —
   tighten the inset + segbar gap so the canvas gets the freed space. */
.ms-scroll.is-fill:has(.org-fullbleed) { padding: 14px 20px 18px; }
.ms-scroll.is-fill:has(.org-fullbleed) > .ms-segbar { margin-bottom: 12px; }
.ms-scroll::-webkit-scrollbar, .ms-nav::-webkit-scrollbar { width: 7px; height: 7px; }
.ms-scroll::-webkit-scrollbar-thumb, .ms-nav::-webkit-scrollbar-thumb {
    background: var(--glass-border); border-radius: 8px;
}
.ms-scroll::-webkit-scrollbar-track { background: transparent; }
/* Die Ecke, wo H- und V-Scrollbar sich treffen, malt der Browser sonst WEISS. */
.ms-scroll::-webkit-scrollbar-corner { background: transparent; }

/* The Profil-Layout (custom-fields) editor hard-codes `calc(100vh …)` heights
   that assume it owns the viewport. Inside `.ms-content` (below the top bar), fill
   the content area so the two panes scroll internally at a stable height — this
   also keeps the list's scroll position from collapsing when it re-renders after
   a drag-drop. */
.ms-scroll.is-fill .cf-layout { height: 100%; }
.ms-scroll.is-fill .cf-preview { max-height: 100%; }

/* ════════════════════════════════════════════════════════════════════════════
   Settings content toolkit — shared macOS-style page/group/row/switch primitives
   that refined sections render inside `.ms-scroll`. Ported from the design skill
   `ui_kits/admin/admin-settings.html`.
   ════════════════════════════════════════════════════════════════════════════ */
.ms-page { max-width: 720px; margin: 0 auto; animation: msFade 0.32s var(--ease-standard); }
.ms-page.wide { max-width: none; }
@keyframes msFade { from { transform: translateY(8px); } to { transform: none; } }
.ms-h1 { font-size: 1.7rem; letter-spacing: -0.03em; }
.ms-intro { color: var(--text-secondary); font-size: 0.92rem; margin: 4px 0 22px; }

.ms-glabel { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); margin: 22px 4px 8px; }
.ms-seclabel { font-size: 0.95rem; font-weight: 700; margin: 22px 2px 12px; }

.ms-group { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 11px;
    overflow: hidden; box-shadow: var(--shadow-sm); }
.ms-row { display: flex; align-items: center; gap: 13px; padding: 11px 15px; min-height: 46px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07); }
.ms-row:last-child { border-bottom: none; }
.ms-row.is-click { cursor: pointer; transition: background var(--transition-fast); }
.ms-row.is-click:hover { background: rgba(255, 255, 255, 0.03); }
.ms-rlabel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ms-label-t { font-size: 0.9rem; font-weight: 500; }
.ms-sub { font-size: 0.78rem; color: var(--text-muted); }
.ms-val { font-size: 0.86rem; color: var(--text-muted); }
.ms-chev { color: var(--text-muted); display: inline-flex; }
.ms-chev svg { width: 16px; height: 16px; }

/* Toggle switch */
.ms-switch { width: 38px; height: 22px; border-radius: 9999px; background: var(--bg-hover);
    border: 1px solid var(--glass-border); position: relative; cursor: pointer;
    transition: all var(--transition-fast); flex-shrink: 0; }
.ms-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--text-muted); transition: all var(--transition-fast); }
.ms-switch.on { background: var(--accent); border-color: var(--accent); }
.ms-switch.on::after { left: 18px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }

/* Editable controls inside a settings row (real forms; not in the static mock) */
.ms-row .ms-input,
.ms-row .ms-select {
    background: var(--bg-input); border: 1px solid var(--glass-border); border-radius: 8px;
    color: var(--text-primary); font-family: var(--font-sans); font-size: 0.86rem;
    padding: 6px 10px; max-width: 260px; min-width: 0; flex-shrink: 0;
}
.ms-row .ms-input:focus,
.ms-row .ms-select:focus { outline: none; border-color: var(--glass-border-hover); }
.ms-row .ms-input-sm { max-width: 110px; }

.ms-form-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.ms-save-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px;
    background: var(--accent); color: #fff; border: 1px solid var(--accent); font-weight: 600;
    font-size: 0.875rem; font-family: var(--font-sans); cursor: pointer; transition: all var(--transition-fast); }
.ms-save-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.ms-save-feedback { font-size: 0.85rem; color: var(--success); }

/* ── Benutzer edit popup (draggable, panel-clamped) ─────────────────────────── */
.usr-pop {
    position: fixed;
    z-index: 101;
    width: 452px;
    max-width: calc(100% - 16px);
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.usr-pop-grip {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; cursor: grab;
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.14), rgba(129, 140, 248, 0.04));
    border-bottom: 1px solid var(--glass-border);
    font-weight: 700; font-size: 0.9rem;
}
.usr-pop-grip:active { cursor: grabbing; }
.usr-pop-x {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.usr-pop-x:hover { color: var(--accent-hover); border-color: var(--glass-border-hover); }
.usr-pop-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.usr-pop-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usr-pop-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.usr-pop-field > span { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.usr-pop-field .admin-input, .usr-pop-field .admin-select { width: 100%; box-sizing: border-box; }
.usr-pop-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.usr-pop-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.usr-pop-pw { display: flex; flex-direction: column; gap: 5px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.usr-pop-hint { font-size: 0.74rem; color: var(--text-muted); }
.usr-pop-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 16px; border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
}

/* ── Shared draggable modal frame (DragModal) ───────────────────────────────── */
.drag-modal-backdrop { position: fixed; inset: 0; z-index: 120; }
.drag-modal {
    position: fixed; z-index: 121;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.drag-modal-grip {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; cursor: grab; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.14), rgba(129, 140, 248, 0.04));
    border-bottom: 1px solid var(--glass-border);
    font-weight: 700; font-size: 0.9rem;
}
.drag-modal-grip:active { cursor: grabbing; }
.drag-modal-x {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.drag-modal-x:hover { color: var(--accent-hover); border-color: var(--glass-border-hover); }
.drag-modal-body { padding: 16px; overflow-y: auto; }
.drag-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Rescue — the emergency nav entry signals in red instead of indigo/white:
   the label is red even at rest, hover adds the dimmed red tint (mirrors the
   white hover), active = strong signal. */
.ms-item.ms-item-danger { color: var(--danger); }
.ms-item.ms-item-danger:hover { background: rgba(248, 113, 113, 0.13); color: var(--danger); }
.ms-item.ms-item-danger.is-active {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 14px rgba(248, 113, 113, 0.6);
}

/* While a fullscreen dashboard-editor modal is open, lift the panel's
   containing-block transform so the overlay centers on the REAL viewport
   (set/removed by dashboard_editor/overlay.rs). No visual change: the
   transform is an identity (translateZ(0), compositing hint only). */
.ms-win.ms-modal-escape {
    transform: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROLES MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Role Form (rf-) — Premium Two-Column Layout ── */
.rf-container {
    position: relative;
    height: calc(100vh - 180px);
    margin-bottom: 6px;
}
@media (max-width: 800px) {
    .rf-container { position: static; height: auto; }
    .rf-editor { position: static; inset: auto; width: 100%; }
    .rf-preview { display: none; }
}

/* ── Editor (left column) — absolutely fills the container, whose height the
   preview column on the right sets, so the editor's bottom always lines up
   with the preview's last box regardless of viewport; longer content scrolls
   inside the editor rather than capping it short. ── */
.rf-editor {
    position: absolute; inset: 0 280px 0 0;
    display: flex; flex-direction: column; gap: 0;
    background: rgba(67,77,123,0.15); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 24px; overflow-y: auto;
    scrollbar-width: none;
}
.rf-editor::-webkit-scrollbar { display: none; }
.rf-editor-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rf-editor-header h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.rf-header-badges { display: flex; gap: 8px; }
.rf-badge {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.72rem; padding: 4px 10px; border-radius: 20px;
    font-weight: 600; transition: all 0.3s;
}
.rf-badge-icon { display: flex; }
.rf-badge-icon svg { width: 12px; height: 12px; }
.rf-badge-perm {
    background: rgba(99,102,241,0.12); color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.2);
}
.rf-badge-mod {
    background: rgba(34,197,94,0.1); color: #86efac;
    border: 1px solid rgba(34,197,94,0.2);
}
/* Administrator state — amber, overrides the base badge colours. */
.rf-badge-admin {
    background: rgba(251,191,36,0.14) !important; color: #fcd34d !important;
    border: 1px solid rgba(251,191,36,0.3) !important;
}

/* ── Sections ── */
.rf-section {
    padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rf-section:last-of-type { border-bottom: none; }
.rf-section-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 12px;
}
.rf-section-num {
    font-size: 0.65rem; font-weight: 700; color: #a5b4fc;
    background: rgba(99,102,241,0.15); padding: 2px 8px;
    border-radius: 6px; letter-spacing: 0.05em; font-family: monospace;
}
.rf-hint {
    font-size: 0.8rem; color: rgba(255,255,255,0.35); margin: 0 0 14px;
}

/* ── Preset chips (Bereiche header) ── */
.rf-preset-row { margin-left: auto; display: flex; gap: 6px; }
.rf-preset-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2); color: #a5b4fc;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.rf-preset-chip:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 0 12px rgba(99,102,241,0.15);
}
.rf-preset-icon { display: flex; }
.rf-preset-icon svg { width: 12px; height: 12px; }
.rf-preset-clear {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45);
}
.rf-preset-clear:hover {
    background: rgba(248,113,113,0.1);
    border-color: rgba(248,113,113,0.25); color: #fca5a5;
    box-shadow: none;
}

/* ── Identity Grid ── */
.rf-identity-grid { display: grid; grid-template-columns: 1fr auto; gap: 20px; }
/* Rides the app-wide dark .input-field; only sized up for the hero position.
   (The old `form-input` class existed nowhere → browser-white input.) */
.rf-name-input { font-size: 1rem !important; padding: 12px 14px !important; }
.rf-name-input:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── Area controls (one graded control per area) ── */
.rf-area-list {
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
    background: rgba(0,0,0,0.12); overflow: hidden;
}
.rf-area {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; padding: 12px 14px; transition: background 0.15s;
}
.rf-area + .rf-area { border-top: 1px solid rgba(255,255,255,0.04); }
.rf-area:hover { background: rgba(255,255,255,0.03); }
.rf-area-label { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rf-area-ic {
    width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
    display: grid; place-items: center; color: #a5b4fc;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.18);
}
.rf-area-ic svg { width: 16px; height: 16px; }
.rf-area-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rf-area-nm { font-weight: 600; font-size: 0.88rem; color: #fff; }
.rf-area-ds { font-size: 0.74rem; color: rgba(255,255,255,0.35); }

/* Segmented pill — one active step per area. */
.rf-seg {
    display: inline-flex; flex: 0 0 auto; gap: 2px; padding: 3px;
    background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
}
.rf-seg-opt {
    border: 0; background: transparent; color: rgba(255,255,255,0.5);
    font: inherit; font-size: 0.76rem; font-weight: 600;
    padding: 6px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.rf-seg-opt:hover { color: #fff; }
.rf-seg-opt.is-active {
    color: #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6);
    box-shadow: 0 4px 14px -4px rgba(99,102,241,0.6);
}
.rf-seg-opt.rf-seg-danger.is-active {
    background: linear-gradient(135deg,#f87171,#ef4444);
    box-shadow: 0 4px 14px -4px rgba(248,113,113,0.5);
}

/* Depth control + optional visibility sub-control stack on the right. */
.rf-area-controls {
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto;
}
.rf-scope { display: flex; align-items: center; gap: 8px; }
.rf-scope-off { display: none; }
.rf-scope-label {
    font-size: 0.66rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.35);
}
.rf-seg-sm { padding: 2px; }
.rf-seg-sm .rf-seg-opt { font-size: 0.7rem; padding: 4px 10px; }

/* ── Capability areas: preset control + collapsible switch panel ── */
.rf-area-cap { flex-direction: column; align-items: stretch; gap: 10px; }
.rf-area-cap.rf-open { background: rgba(99,102,241,0.05); }
.rf-area-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
}
/* "Individuell" is a status, not a button. */
.rf-seg-custom { color: rgba(255,255,255,0.32); cursor: default; }
.rf-seg-custom.is-active {
    color: #1a0b2e; background: linear-gradient(135deg,#a78bfa,#f0abfc);
    box-shadow: 0 4px 14px -4px rgba(167,139,250,0.5);
}
.rf-det {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    background: transparent; border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); font: inherit; font-size: 0.74rem; font-weight: 600;
    padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: all 0.15s;
}
.rf-det:hover { border-color: rgba(99,102,241,0.5); color: #fff; }
.rf-det-ch svg { width: 13px; height: 13px; transition: transform 0.18s; }
.rf-det-on .rf-det-ch svg { transform: rotate(180deg); }
.rf-panel { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.rf-panel-open { max-height: 520px; }
.rf-panel-in { padding: 0 2px 6px 44px; }
.rf-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .rf-caps { grid-template-columns: 1fr; } }
.rf-cap {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
    background: rgba(0,0,0,0.16); cursor: pointer; transition: all 0.15s; user-select: none;
}
.rf-cap:hover { border-color: rgba(99,102,241,0.35); }
.rf-cap-on { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.1); }
.rf-cap-danger.rf-cap-on { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.1); }
.rf-cap-txt { flex: 1; min-width: 0; }
.rf-cap-nm { font-size: 0.84rem; font-weight: 600; color: #fff; }
.rf-cap-ds { font-size: 0.72rem; color: rgba(255,255,255,0.38); }
.rf-sw {
    width: 38px; height: 22px; flex: 0 0 auto; border-radius: 999px;
    background: rgba(255,255,255,0.12); position: relative; transition: background 0.18s;
}
.rf-sw::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; transition: transform 0.18s; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.rf-cap-on .rf-sw { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.rf-cap-on .rf-sw::after { transform: translateX(16px); }
.rf-cap-danger.rf-cap-on .rf-sw { background: linear-gradient(135deg,#f87171,#ef4444); }

/* ── Administrator switch ── */
.rf-admin-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    width: 100%; text-align: left; margin-top: 12px; padding: 14px 16px;
    border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(251,191,36,0.2);
    background: linear-gradient(180deg, rgba(251,191,36,0.05), rgba(251,191,36,0.02));
    transition: border-color 0.2s, background 0.2s;
}
.rf-admin-row:hover { border-color: rgba(251,191,36,0.35); }
.rf-admin-row .rf-area-ic {
    background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.22); color: #fcd34d;
}
.rf-admin-on {
    border-color: rgba(251,191,36,0.4);
    background: linear-gradient(180deg, rgba(251,191,36,0.1), rgba(251,191,36,0.04));
}
.rf-toggle {
    width: 46px; height: 27px; border-radius: 999px; flex: 0 0 auto; position: relative;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.12);
    transition: background 0.18s, border-color 0.18s;
}
.rf-toggle::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 21px; height: 21px; border-radius: 50%;
    background: rgba(255,255,255,0.6); transition: transform 0.18s, background 0.18s;
}
.rf-toggle-on { background: linear-gradient(135deg,#f59e0b,#fbbf24); border-color: transparent; }
.rf-toggle-on::after { transform: translateX(19px); background: #fff; }

/* ── Actions ── */
.rf-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding-top: 20px; margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.rf-submit-btn { padding: 10px 28px !important; font-weight: 600 !important; }

/* ── Preview (right column) ── */
/* Preview fills the container height alongside the editor; its Bereiche box
   grows so the right-hand blocks fill the taller column (and scrolls if a role
   touches every area). */
.rf-preview {
    position: absolute; inset: 0 0 0 auto; width: 260px;
    display: flex; flex-direction: column; gap: 14px;
}
/* The "Bereiche" box (3rd child: after header + card) grows to fill the column
   so the right-hand blocks reach the same bottom as the editor. */
.rf-preview .rf-preview-section:nth-of-type(3) {
    flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: none;
}
.rf-preview .rf-preview-section:nth-of-type(3)::-webkit-scrollbar { display: none; }
.rf-preview-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
}
.rf-preview-icon { display: flex; color: rgba(255,255,255,0.3); }
.rf-preview-icon svg { width: 14px; height: 14px; }
.rf-preview-title {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(255,255,255,0.3);
}
.rf-preview-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 18px 20px; text-align: center;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
}
.rf-preview-dot {
    width: 36px; height: 36px; border-radius: 50%;
    margin-bottom: 10px; transition: background-color 0.3s;
    box-shadow: 0 0 16px rgba(99,102,241,0.2);
}
.rf-preview-name {
    font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 4px;
}
.rf-preview-meta {
    font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.rf-preview-section {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px; background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
}
.rf-preview-section-title {
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.3); margin-bottom: 4px;
}
.rf-preview-empty {
    font-size: 0.78rem; color: rgba(255,255,255,0.2); font-style: italic;
}
.rf-preview-perms { display: flex; flex-wrap: wrap; gap: 4px; }
.rf-preview-perm {
    font-size: 0.65rem; padding: 2px 7px; border-radius: 4px;
    font-weight: 500; transition: all 0.2s;
}
.rf-preview-perm-read {
    background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2);
}
.rf-preview-perm-write {
    background: rgba(234,179,8,0.1); color: #fde68a; border: 1px solid rgba(234,179,8,0.2);
}
.rf-preview-perm-danger {
    background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2);
}

/* ── Color Picker (shared) ── */
.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch-active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); transform: scale(1.15); }

/* ── Form Actions (shared) ── */
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ── Roles Grid ── */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* ── Role Card ── */
.role-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: 18px;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: transform var(--transition-normal),
        border-color var(--transition-normal), box-shadow var(--transition-normal);
}
/* Design card-lift: rises, indigo border, shadow steps up. */
.role-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}
.role-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
/* Role dot glows in its own colour (design: .rl-dot). */
.role-color-dot { width: 12px; height: 12px; border-radius: var(--radius-full); flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.role-card-info { flex: 1; }
.role-name { font-size: 1rem; font-weight: 600; margin: 0; }
.role-meta { font-size: 0.78rem; color: var(--text-muted); }
.role-card-actions { display: flex; gap: 4px; }

/* ── Role Tags (Permissions) — coloured by action (read/write/delete) ── */
.role-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.role-tag {
    font-size: 0.7rem; padding: 2px 8px; border-radius: var(--radius-xs, 4px);
    font-family: var(--font-mono);
    background: var(--accent-soft); color: var(--text-accent); border: 1px solid rgba(99,102,241,0.2);
}
.role-tag.p-read { background: rgba(96,165,250,0.12); color: var(--info); border-color: rgba(96,165,250,0.22); }
.role-tag.p-write { background: rgba(251,191,36,0.12); color: var(--warning); border-color: rgba(251,191,36,0.22); }
.role-tag.p-delete { background: rgba(248,113,113,0.12); color: var(--danger); border-color: rgba(248,113,113,0.22); }
.role-tag-more { background: var(--bg-hover); color: var(--text-muted); border-color: var(--glass-border); }

/* ── Module Badges ── */
.role-modules { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.module-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
    background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.2);
    text-transform: capitalize;
}

/* ── Role Card Footer ── */
.role-card-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }

/* ── Form Error ── */
.form-error {
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5; padding: 10px 14px; border-radius: 8px;
    font-size: 0.85rem; margin-bottom: 14px;
}
.text-sm { font-size: 0.8rem; }


/* ═══════════════════════════════════════════════════════════════════════════
   TEMPLATES MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Filter Bar ── */
.template-filter { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-btn {
    padding: 6px 14px; border-radius: 8px; font-size: 0.83rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); }
.filter-btn-active {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4);
    color: #a5b4fc;
}

/* ── Template Form ── */
.template-form {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
.template-form h3 { margin: 0 0 16px; font-size: 1.1rem; }
.template-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.template-textarea { font-family: 'JetBrains Mono', 'Fira Code', monospace; resize: vertical; min-height: 160px; }
.template-body-header { display: flex; justify-content: space-between; align-items: center; }
.btn-text {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: 0.8rem; padding: 0;
}
.btn-text:hover { text-decoration: underline; }

/* ── Variable Hints ── */
.variable-hints {
    background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15);
    border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.variable-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-top: 8px; }
.variable-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.variable-key { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; color: #a5b4fc; font-size: 0.75rem; }
.variable-desc { color: rgba(255,255,255,0.6); }

/* ── Templates Grid ── */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

/* ── Template Card ── */
.template-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 18px; transition: all 0.2s;
}
.template-card:hover { border-color: rgba(99,102,241,0.3); background: rgba(255,255,255,0.05); }
.template-inactive { opacity: 0.5; }
.template-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.template-category-badge {
    font-size: 0.75rem; padding: 3px 10px; border-radius: 6px;
    background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2);
}
.template-category-badge[data-category="note"] { background: rgba(234,179,8,0.12); color: #fde68a; border-color: rgba(234,179,8,0.2); }
.template-category-badge[data-category="task"] { background: rgba(34,197,94,0.12); color: #86efac; border-color: rgba(34,197,94,0.2); }
.template-card-actions { display: flex; gap: 4px; }
.template-name { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.template-subject { font-size: 0.83rem; color: rgba(255,255,255,0.6); margin: 0 0 8px; }
.template-preview {
    font-size: 0.78rem; color: rgba(255,255,255,0.4); margin: 0 0 12px;
    background: rgba(255,255,255,0.02); border-radius: 6px; padding: 10px;
    white-space: pre-wrap; word-wrap: break-word; border: 1px solid rgba(255,255,255,0.04);
    font-family: inherit; max-height: 120px; overflow-y: auto;
}
.template-card-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }


/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN DETAIL SHELL — full-bleed editor host
   Used by AdminPage for full-bleed canvas/editor views (Canva, Pipelines,
   SalesKnowledge, Automation, Dashboard, Call Grid). Navigation is handled by
   the persistent company rail (see _admin_overview.css); there is no per-page
   back-button header here anymore.
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-detail-page { display: flex; flex-direction: column; gap: 20px; }
.admin-detail-content { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN SUB-PAGES — Pipelines, Automation, Knowledge, Call Settings
   ═══════════════════════════════════════════════════════════════════════════ */

/* Small success toast (e.g. "✓ Team erstellt") shown bottom-right. */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
}

/* User-list filter bar (type / team / role) + the teams section at the bottom. */
.admin-filter-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.admin-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}
.admin-teams-section {
    margin-top: var(--space-md);
}
.admin-teams-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 var(--space-sm);
}

/* ── Shared Admin Section ── */
.admin-section { display: flex; flex-direction: column; gap: 20px; }
.admin-section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--space-xl); padding-bottom: var(--space-lg); border-bottom: 1px solid var(--glass-border); flex-wrap: wrap; }
.admin-section-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-primary); margin: 0; }
.admin-section-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin: var(--space-xs) 0 0; }

.admin-create-form {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: rgba(67,77,123,0.2); padding: 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.admin-create-form .input-field { flex: 1; min-width: 180px; }
.admin-create-form .input-textarea { flex-basis: 100%; min-width: 100%; }

.admin-empty-state {
    text-align: center; padding: 60px 40px; color: rgba(255,255,255,0.35);
    background: rgba(67,77,123,0.1); border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.08);
}

/* ── Pipelines ── */
.admin-pipelines-list { display: flex; flex-direction: column; gap: 12px; }
.pipeline-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; overflow: hidden; transition: all 0.2s;
}
.pipeline-card-expanded { border-color: rgba(99,102,241,0.3); }
.pipeline-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; cursor: pointer; transition: background 0.2s;
}
.pipeline-card-header:hover { background: rgba(99,102,241,0.06); }
.pipeline-card-header h3 { font-size: 1rem; color: #fff; margin: 0; }
.pipeline-expand-icon { color: rgba(255,255,255,0.4); font-size: 0.8rem; }

.pipeline-stages { padding: 0 20px 20px; }
.stages-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stages-header h4 { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin: 0; }
.stages-list { display: flex; flex-direction: column; gap: 8px; }
.stage-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: rgba(0,0,0,0.15); border-radius: 8px;
}
.stage-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.stage-name { flex: 1; color: #fff; font-size: 0.85rem; }
.stage-prob { color: rgba(255,255,255,0.4); font-size: 0.8rem; min-width: 40px; text-align: right; }
.stage-create-form { padding: 12px; }
.stage-create-form input[type="color"] { width: 40px; height: 32px; border: none; border-radius: 6px; cursor: pointer; }

.btn-small {
    padding: 4px 10px; font-size: 0.75rem; background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.btn-small:hover { background: rgba(99,102,241,0.3); }
.btn-danger-sm { background: transparent; border: none; color: rgba(255,100,100,0.6); cursor: pointer; font-size: 0.9rem; }
.btn-danger-sm:hover { color: #ff6464; }
.empty-hint { font-size: 0.85rem; color: rgba(255,255,255,0.3); text-align: center; padding: 16px 0; }
.input-small { max-width: 100px; }

/* ── Automation ── */
.admin-automations-list { display: flex; flex-direction: column; gap: 12px; }
.automation-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px 20px; transition: all 0.2s;
}
.automation-active { border-color: rgba(20,163,6,0.3); }
.automation-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.automation-info { flex: 1; }
.automation-info h3 { font-size: 1rem; color: #fff; margin: 0 0 6px; }
.automation-trigger-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.15); color: #a5b4fc;
}
.automation-actions { display: flex; align-items: center; gap: 8px; }
.automation-card-bottom { margin-top: 10px; }
.automation-stat { font-size: 0.8rem; color: rgba(255,255,255,0.35); }

/* ── Toggles ── */
.toggle-btn {
    padding: 4px 12px; font-size: 0.75rem; border-radius: 20px;
    border: 1px solid; cursor: pointer; transition: all 0.2s;
}
.toggle-on { background: rgba(20,163,6,0.15); border-color: rgba(20,163,6,0.4); color: #4ade80; }
.toggle-off { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }
.toggle-on:hover { background: rgba(20,163,6,0.25); }
.toggle-off:hover { background: rgba(255,255,255,0.08); }

/* ── Knowledge ── */
.knowledge-articles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.knowledge-card {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px 20px; transition: all 0.2s;
}
.knowledge-draft { opacity: 0.6; border-style: dashed; }
.knowledge-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.knowledge-category-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.15); color: #a5b4fc;
}
.knowledge-card-actions { display: flex; gap: 6px; align-items: center; }
.knowledge-title { font-size: 1rem; color: #fff; margin: 0 0 8px; }
.knowledge-preview { font-size: 0.8rem; color: rgba(255,255,255,0.35); margin: 0; line-height: 1.4; }

.category-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 5px 12px; font-size: 0.75rem; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); }
.filter-active { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }

/* ── Settings Form (Call Settings) ── */
.settings-form {
    display: flex; flex-direction: column; gap: 20px;
    background: rgba(67,77,123,0.15); border-radius: 16px; padding: 24px;
    border: 1px solid rgba(255,255,255,0.06); max-width: 600px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); font-weight: 500; }
.form-toggles { gap: 14px; }
.form-toggle-row { display: flex; justify-content: space-between; align-items: center; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.btn-save { padding: 10px 24px; }
.save-feedback { font-size: 0.85rem; color: #4ade80; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ══════════════════════════════════════════════════════════════════
   Admin · Hintergründe (collectible-background catalog)
   Prefix: .abg-*  — reuses the .ms-* / .btn / .eacc-badge toolkit for
   the rest. Only the thumbnail grid + tier badges live here.
   ══════════════════════════════════════════════════════════════════ */

.abg-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* Create form — a plain .ms-group; only the actions row + toggle spacing. */
.abg-form { margin-bottom: 20px; }
.abg-form-actions { justify-content: flex-end; }
.abg-src-toggle { display: flex; gap: 8px; margin-left: auto; }

/* ── Catalog grid ── */
.abg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.abg-card {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color var(--transition-fast), opacity var(--transition-fast);
}
.abg-card:hover { border-color: var(--glass-border-hover); }
.abg-card.is-inactive { opacity: 0.55; }

/* Thumbnail + tier badge overlay. */
.abg-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.abg-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.abg-thumb-ph {
    display: flex;
    color: var(--text-muted);
    opacity: 0.5;
}
.abg-thumb-ph svg { width: 34px; height: 34px; }

.abg-tier {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    color: #1a1a1a;
    backdrop-filter: blur(4px);
}
.abg-tier-bronze  { background: linear-gradient(135deg, #cd7f32, #e0a56a); }
.abg-tier-silver  { background: linear-gradient(135deg, #b8b8b8, #e8e8e8); }
.abg-tier-gold    { background: linear-gradient(135deg, #e6b400, #ffdb58); }
.abg-tier-special { background: linear-gradient(135deg, #8b5cf6, #c084fc); color: #fff; }

/* Card body. */
.abg-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 14px 14px;
}
.abg-card-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.abg-card-req { font-size: 0.78rem; color: var(--text-secondary); }
.abg-card-meta { display: flex; }

.abg-card-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.abg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 0;
}
/* Darstellung-Select (Füllen/Einpassen/Zentriert/Kacheln) in der Karte. */
.abg-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
    gap: 8px;
}
/* Eigenständig gestylt: `.ms-select` greift nur innerhalb von `.ms-row` —
   hier stünde sonst das weiße Native-Select. */
.abg-mode-select {
    flex: 0 1 130px;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    padding: 3px 22px 3px 8px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}
.abg-mode-select:focus {
    outline: none;
    border-color: var(--glass-border-hover);
}

/* Flächenfarbe: nativer Color-Swatch im Glass-Rahmen + „ד zum Zurücksetzen. */
.abg-color-ctl {
    display: flex;
    align-items: center;
    gap: 6px;
}
.abg-color-input {
    width: 44px;
    height: 26px;
    padding: 2px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-input);
    cursor: pointer;
}
.abg-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.abg-color-input::-webkit-color-swatch { border: none; border-radius: 5px; }
.abg-color-reset {
    width: 22px;
    height: 22px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}
.abg-color-reset:hover { color: var(--text-primary); border-color: var(--glass-border-hover); }

/* Grant-Panel: Tenant-Auswahl über der Nutzerliste. */
.abg-tenant-select {
    width: 100%;
    flex: none;
    margin-bottom: 6px;
}
.abg-tenant-row {
    border-bottom: 1px solid var(--glass-border-subtle);
    margin-bottom: 4px;
    padding-bottom: 6px;
}

.abg-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.abg-card-actions .btn-danger-sm { margin-left: auto; }
.abg-card-actions .btn-danger-sm svg { width: 16px; height: 16px; }

/* ── Grant panel ── */
.abg-grants {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.abg-grants-search { width: 100%; }
.abg-grant-list {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}
.abg-grant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px;
    font-size: 0.82rem;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border);
}
.abg-grant-row:last-child { border-bottom: none; }
.abg-grant-row:hover { background: rgba(255, 255, 255, 0.03); }
.abg-grant-name { color: var(--text-primary); }

/* Nativer Datei-Input: der Browser-Button ist sonst WEISS — Glass-Look. */
.ms-row input[type="file"] { color: var(--text-muted); font-size: 0.82rem; }
.ms-row input[type="file"]::file-selector-button {
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 7px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    padding: 5px 12px;
    margin-right: 10px;
    cursor: pointer;
}
.ms-row input[type="file"]::file-selector-button:hover {
    border-color: var(--glass-border-hover);
}

/* Admin · API — tenant API keys (list, one-time reveal, revoke) */

.apik-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    font-size: 0.86rem;
}

.apik-scope {
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light, #a5b4fc);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* One-time key reveal */
.apik-reveal {
    margin: 20px 0 8px;
    padding: 16px 18px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
}

.apik-reveal-head {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.apik-reveal-hint {
    color: var(--warning);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.apik-reveal-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.apik-token {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(6, 10, 20, 0.6);
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
}

.apik-copy {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.apik-copy:hover {
    background: var(--accent-hover, #818cf8);
}

/* Key list */
.apik-prefix {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
}

.apik-badge {
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.apik-badge.is-active {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.apik-badge.is-revoked {
    background: rgba(100, 116, 139, 0.18);
    color: var(--text-muted, #94a3b8);
}

.apik-badge.is-expired {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.apik-revoke {
    margin-left: 10px;
    padding: 5px 12px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 8px;
    background: transparent;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.apik-revoke:hover,
.apik-revoke.is-armed {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--danger);
}

/* Scope-Auswahl (Checkboxen) beim Anlegen */
.apik-scopes { display: flex; flex-direction: column; gap: 6px; }
.apik-scope-opt {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 0.85rem; color: var(--text-secondary);
}
.apik-scope-opt input { accent-color: var(--text-accent); }

/* Rollen-Stil: Bereiche mit Stufen-Segmenten (Kein/<Stufe>) */
.apik-seg {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--bg-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
}
.apik-seg-btn {
    border: none; background: none; cursor: pointer;
    padding: 5px 16px; border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    transition: var(--transition-fast); white-space: nowrap;
}
.apik-seg-btn.is-active { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.apik-seg-btn.is-grant.is-active { background: var(--text-accent); color: #fff; }
/* Bereichs-Chips an den vorhandenen Keys */
.apik-pv-chip {
    padding: 2px 10px; border-radius: var(--radius-full);
    background: var(--bg-input); border: 1px solid var(--glass-border-hover);
    font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
}
.apik-key-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* Admin · Upload-Leitfäden — guide list + position editor */

.upg-guide.is-selected {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: inset 2px 0 0 var(--accent);
}

.upg-add {
    margin-left: 10px;
    padding: 7px 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light, #a5b4fc);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.upg-add:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: var(--accent);
}

/* One position row: arrows | fields | required | remove */
.upg-pos {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--glass-border);
}

.upg-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upg-arrow {
    width: 22px;
    height: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
}

.upg-arrow:hover:not(:disabled) {
    color: #fff;
    border-color: var(--glass-border-hover, rgba(99, 102, 241, 0.5));
}

.upg-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.upg-fields {
    flex: 1;
    display: flex;
    gap: 10px;
    min-width: 0;
}

/* .ms-input is only styled inside .ms-row — restyle it for position rows,
   otherwise the browser default paints white boxes on the dark surface. */
.upg-pos .ms-input {
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    padding: 6px 10px;
    max-width: none;
}

.upg-pos .ms-input:focus {
    outline: none;
    border-color: var(--glass-border-hover);
}

.upg-title {
    flex: 0 0 34%;
}

.upg-hint {
    flex: 1;
}

.upg-req {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.upg-req-label {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.upg-remove {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 7px;
    background: transparent;
    color: var(--danger);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.upg-remove:hover {
    background: rgba(248, 113, 113, 0.15);
}

.upg-editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--glass-border);
}

.upg-editor-actions .upg-add {
    margin-left: 0;
}

/* "Nicht zugeordnet" inbox */
.upg-inbox-row .upg-add {
    margin-left: auto;
}

.upg-inbox-row .apik-revoke {
    margin-left: 10px;
}

.upg-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 16px 14px;
    border-top: 1px dashed var(--glass-border);
}

.upg-picker .ms-input {
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.86rem;
    padding: 6px 10px;
}

.upg-picker-hit {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.upg-picker-hit:hover {
    border-color: var(--glass-border-hover);
    background: rgba(99, 102, 241, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTOMATION — Card Grid (Two-Step Flow, board.svg Design)
   Step 1: pc-list-page card grid → Step 2: fullscreen FlowCanvas
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reuse pipeline list-page styles (pc-list-page, pc-pipe-grid, pc-pipe-card) */

/* Automation-specific card meta row */
.pc-pipe-card-meta {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-bottom: 6px;
}
.pc-pipe-card-toggle {
    padding: 4px 10px; font-size: 0.72rem; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s;
}
.pc-pipe-card-toggle:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* Active/Inactive status dot */
.auto-status-dot {
    font-size: 0.72rem; padding: 2px 8px; border-radius: 20px;
}
.auto-active {
    color: #4ade80; background: rgba(20,163,6,0.12);
}
.auto-inactive {
    color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.04);
}

/* ── Automation Canvas fullbleed ─── */
/* Complete flex chain: app-layout → app-content-area → app-main → page-container → ... → flow-editor */
.app-layout:has(.flow-editor) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}
.app-content-area:has(.flow-editor) {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}
/* (Removed legacy `.app-main:has(.flow-editor)` full-page overrides — the flow
   editor now renders inside the admin window panel, which handles fill/padding;
   zeroing `.app-main` padding here made Organigramm/Automation sit flush.) */
.admin-detail-page:has(.flow-editor) {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden; gap: 0;
}
.admin-detail-content:has(.flow-editor) {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════
   Custom Fields Redesign — Notion-style Field Manager
   ═══════════════════════════════════════════════════════════════════ */

/* Two-Column Layout: Editor left, Preview right */
.cf-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 24px;
    height: calc(100vh - 160px);
}
@media (max-width: 1000px) {
    .cf-layout { grid-template-columns: 1fr; }
    .cf-preview { display: none; }
}
.cf-editor {
    min-width: 0; overflow-y: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.cf-editor::-webkit-scrollbar { display: none; }

/* ── Preview Panel (right side) ── */
.cf-preview {
    display: flex; flex-direction: column;
    max-height: calc(100vh - 160px);
    overflow: hidden;
}
.cf-preview-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-bottom: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; flex-shrink: 0;
}
.cf-preview-icon { display: flex; color: rgba(255,255,255,0.3); }
.cf-preview-icon svg { width: 14px; height: 14px; }
.cf-preview-title {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(255,255,255,0.3);
}
.cf-preview-scroll {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    scrollbar-width: none; -ms-overflow-style: none;
    padding-bottom: 24px;
}
.cf-preview-scroll::-webkit-scrollbar { display: none; }

/* Preview — Profile Card (top) */
.cf-preview-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    overflow: hidden; flex-shrink: 0;
}
.cf-preview-profile {
    display: flex; flex-direction: column; align-items: center;
    padding: 28px 20px 20px;
}
.cf-preview-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.3));
    border: 3px solid rgba(99,102,241,0.4);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    font-size: 1.2rem; font-weight: 700; color: #a5b4fc;
}
.cf-preview-avatar svg { width: 28px; height: 28px; color: #a5b4fc; }
.cf-preview-kd {
    font-size: 0.72rem; color: rgba(255,255,255,0.35);
    font-family: monospace; margin-bottom: 4px;
}
.cf-preview-name {
    font-size: 1.05rem; font-weight: 700; color: #fff;
}

/* Preview — Group card (each group = separate box) */
.cf-preview-group-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
}
.cf-preview-group-title {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(99,102,241,0.7);
    padding: 12px 16px 8px;
}
.cf-preview-group-content {
    padding: 0 16px 12px;
}
.cf-preview-group-empty {
    font-size: 0.78rem; color: rgba(255,255,255,0.2); font-style: italic;
    padding: 4px 0;
}

/* Preview — Contact info card */
.cf-preview-info-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px 16px;
}
.cf-preview-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.cf-preview-row:last-child { border-bottom: none; }
.cf-preview-row-label {
    font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.cf-preview-row-val {
    font-size: 0.78rem; color: rgba(255,255,255,0.7); font-weight: 500;
}
.cf-preview-row-icon { display: flex; color: rgba(255,255,255,0.2); flex-shrink: 0; }
.cf-preview-row-icon svg { width: 13px; height: 13px; }

/* Preview — Custom Field entries (inside group cards) */
.cf-preview-field {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.cf-preview-field:last-child { border-bottom: none; }
.cf-preview-field-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.cf-preview-field-icon { display: flex; color: rgba(255,255,255,0.2); }
.cf-preview-field-icon svg { width: 12px; height: 12px; }
.cf-preview-req { color: #f87171; font-size: 0.75rem; margin-left: 2px; }
.cf-preview-field-value {
    font-size: 0.78rem; color: rgba(255,255,255,0.25);
    font-style: italic;
}

/* ── Widget Block in Editor ───────────────────────────── */
.cf-widget-block {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 16px;
    transition: all 0.2s;
}
.cf-widget-block:hover { border-color: rgba(99, 102, 241, 0.25); }
.cf-widget-block.cf-drag-over {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.06);
}
.cf-widget-block-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; cursor: grab;
}
.cf-widget-block-left {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.cf-widget-block-icon {
    font-size: 1.1rem; display: flex; align-items: center;
}
.cf-widget-block-name {
    font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0;
}
.cf-widget-block-desc {
    font-size: 0.72rem; color: rgba(255,255,255,0.35); margin-top: 2px;
}
.cf-widget-block-badge {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    padding: 3px 10px; border-radius: 6px;
    background: rgba(99, 102, 241, 0.1); color: #a5b4fc;
    letter-spacing: 0.04em;
}
.cf-widget-block-actions {
    display: flex; align-items: center; gap: 8px;
}

/* Preview — Widget preview cards */
.cf-preview-widget {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 14px;
    padding: 12px 16px;
}
.cf-preview-widget-header {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
}
.cf-preview-widget-icon { font-size: 0.85rem; }
.cf-preview-widget-title {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(99, 102, 241, 0.7);
}
.cf-preview-widget-body {
    font-size: 0.75rem; color: rgba(255,255,255,0.3); font-style: italic;
}
.cf-preview-widget-disabled {
    opacity: 0.35; filter: grayscale(0.5);
}

/* SVG inside buttons */
.cf-btn-svg { display: inline-flex; }
.cf-btn-svg svg { width: 14px; height: 14px; }


/* ── Widget Palette Popup ──────────────────────────────────────── */
.cf-palette-backdrop {
    position: fixed; inset: 0; z-index: 1999;
}
.cf-widget-palette {
    position: fixed; top: 80px; right: 20px;
    width: 340px; max-height: 480px;
    background: rgba(15, 18, 40, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 20px rgba(99,102,241,0.08);
    z-index: 2000;
    display: flex; flex-direction: column;
    /* Fade only — NOT editModalIn: that animation translates(-50%,-50%) for a
       centered modal, which fights this palette's corner anchor + drag transform
       and makes it jump on open. */
    animation: fadeIn 0.15s var(--ease-standard);
    overflow: hidden;
}
.cf-widget-palette-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cf-widget-palette-header h3 {
    margin: 0; font-size: 0.9rem; font-weight: 700; color: #fff;
}
.cf-widget-palette-scroll {
    flex: 1; overflow-y: auto; padding: 8px;
    scrollbar-width: thin;
}
.cf-widget-palette-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    transition: all 0.15s; cursor: default;
    background: rgba(255,255,255,0.02);
    margin-bottom: 4px;
}
.cf-widget-palette-item:hover {
    background: rgba(99, 102, 241, 0.06);
}
.cf-widget-palette-active {
    border-left: 3px solid rgba(99, 102, 241, 0.5);
}
.cf-widget-palette-hint {
    font-size: 0.7rem; color: rgba(255,255,255,0.3); font-style: italic;
    margin: 0; padding: 4px 18px 8px;
}
.cf-widget-palette-svg { display: flex; color: #a5b4fc; flex-shrink: 0; }
.cf-widget-palette-svg svg { width: 18px; height: 18px; }
.cf-widget-palette-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.cf-widget-palette-name {
    font-size: 0.82rem; font-weight: 600; color: #fff;
}
.cf-widget-palette-desc {
    font-size: 0.65rem; color: rgba(255,255,255,0.35);
}
.cf-widget-block-svg { display: flex; color: #a5b4fc; flex-shrink: 0; }
.cf-widget-block-svg svg { width: 18px; height: 18px; }
.cf-preview-widget-svg { display: flex; color: rgba(99,102,241,0.7); flex-shrink: 0; }
.cf-preview-widget-svg svg { width: 12px; height: 12px; }

/* ── Drop Indicators (between items) ─────────────────────────── */
.cf-drop-indicator {
    position: relative;
    height: 0;
    padding: 6px 0;
    transition: padding 0.15s ease;
    cursor: default;
}
.cf-drop-indicator-line {
    height: 0;
    border-radius: 2px;
    transition: all 0.15s ease;
    position: relative;
}
.cf-drop-indicator-active {
    padding: 10px 0;
}
.cf-drop-indicator-active .cf-drop-indicator-line {
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), transparent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}
.cf-drop-indicator-active .cf-drop-indicator-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    animation: dropPulse 1s ease infinite;
}
@keyframes dropPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

/* Drag-over glow on groups AND widget blocks — big hit area */
.cf-group.cf-drag-over,
.cf-widget-block.cf-drag-over {
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.15), inset 0 0 0 1px rgba(99,102,241,0.15);
    background: rgba(99, 102, 241, 0.06) !important;
    transition: all 0.15s ease;
}

/* ── Widget Blocks (in groups list) ──────────────────────────── */
.cf-widget-block {
    background: var(--glass-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.06));
    border-radius: var(--radius-md, 12px);
    padding: 12px 16px; margin-bottom: 8px;
    transition: all 0.15s; cursor: grab;
    border-left: 3px solid rgba(99, 102, 241, 0.3);
}
.cf-widget-block:hover {
    border-left-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.04);
}
.cf-widget-block.cf-drag-over {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.12);
}
.cf-widget-block-header {
    display: flex; justify-content: space-between; align-items: center;
}
.cf-widget-block-left {
    display: flex; align-items: center; gap: 10px;
}
.cf-widget-block-name {
    margin: 0; font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.85);
}
.cf-widget-block-actions {
    display: flex; align-items: center; gap: 8px;
}
.cf-widget-block-badge {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 2px 8px; border-radius: 6px;
    background: rgba(99, 102, 241, 0.12); color: #a5b4fc;
}



/* Sections (Verfügbar / Aktiv) + footer with the custom-box create button */
.cf-widget-palette-section {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary, #8b8fa3);
}

.cf-widget-palette-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

/* Header */
.cf-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-xl); padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--glass-border); gap: 20px;
}
.cf-header-info { flex: 1; }
.cf-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-primary); margin: 0; }
.cf-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin: var(--space-xs) 0 0; line-height: 1.5; }

/* Error */
.cf-error {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; margin-bottom: 16px;
    background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 12px; color: #f87171; font-size: 0.85rem;
}
.cf-error button {
    background: none; border: none; color: #f87171; cursor: pointer; font-size: 1.1rem;
}

/* Buttons */
.cf-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; font-size: 0.85rem; font-weight: 600;
    border-radius: 12px; border: 1px solid transparent;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cf-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; border: none;
}
.cf-btn-primary:hover {
    background: linear-gradient(135deg, #7c7ff7, #9d76f8);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.cf-btn-ghost {
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.08);
}
.cf-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.cf-btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 8px; }
.cf-btn-add {
    background: rgba(99, 102, 241, 0.1); color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}
.cf-btn-add:hover {
    background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.35);
}
.cf-btn-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; font-size: 0.8rem;
}
.cf-btn-icon svg { width: 14px; height: 14px; }
.cf-btn-danger:hover {
    background: rgba(248, 113, 113, 0.15); color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.cf-btn-tiny { width: 24px; height: 24px; border-radius: 6px; font-size: 0.9rem; }

/* Input */
.cf-input {
    width: 100%; padding: 10px 14px; font-size: 0.88rem;
    background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; color: #fff; outline: none;
    transition: all 0.15s;
}
.cf-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.cf-input::placeholder { color: rgba(255,255,255,0.25); }
.cf-input-inline { width: 200px; padding: 6px 10px; font-size: 0.9rem; font-weight: 600; }

/* New group inline form */
.cf-new-group {
    display: flex; gap: 10px; align-items: center;
    padding: 16px 20px; margin-bottom: 20px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 14px;
    animation: fadeSlideDown 0.2s ease;
}
.cf-new-group .cf-input { flex: 1; }
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading */
.cf-loading {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 60px; color: rgba(255,255,255,0.3); font-size: 0.85rem;
}

/* ── Groups ── */
.cf-groups { display: flex; flex-direction: column; gap: 12px; min-height: 200px; }

.cf-group {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    transition: all 0.2s;
    overflow: hidden;
}
.cf-group:hover { border-color: rgba(255,255,255,0.1); }
.cf-group.cf-drag-over {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.03);
}

.cf-group-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; cursor: pointer;
    transition: background 0.15s;
}
.cf-group-header:hover { background: rgba(255,255,255,0.02); }
.cf-group-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cf-drag-handle {
    color: rgba(255,255,255,0.2); font-size: 0.9rem; cursor: grab;
    padding: 4px 2px; user-select: none; letter-spacing: -1px;
}
.cf-drag-handle:hover { color: rgba(255,255,255,0.5); }
.cf-group-name {
    font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0;
    cursor: text; transition: color 0.15s;
}
.cf-group-name:hover { color: #a5b4fc; }
.cf-group-count {
    font-size: 0.75rem; color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.04); padding: 3px 10px;
    border-radius: 20px; white-space: nowrap;
}
.cf-group-actions { display: flex; align-items: center; gap: 8px; }
.cf-chevron {
    color: rgba(255,255,255,0.3); font-size: 0.9rem;
    transition: transform 0.2s; display: inline-block;
}
.cf-chevron.collapsed { transform: rotate(-90deg); }

/* ── Fields ── */
/* NOTE: no entrance animation here. CSS animations REPLAY when a node is
   re-inserted, and the keyed layout list moves (remove+insert) group cards on
   every drag-drop — an animated .cf-fields made the whole group section
   collapse+fade on each drop (the "flicker"). */
.cf-fields {
    padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 8px;
}
@keyframes fieldsFadeIn {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 2000px; }
}
.cf-fields-empty {
    text-align: center; padding: 24px; color: rgba(255,255,255,0.25);
    font-size: 0.85rem; font-style: italic;
}

/* ── Field Card ── */
.cf-field-card {
    padding: 14px 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    transition: all 0.15s;
    cursor: default;
}
.cf-field-card:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}
/* Insertion-line affordance: the dragged field lands BEFORE this card
   (matches the widget drop-indicator language, replaces the full-card glow). */
.cf-field-card.cf-drag-over {
    box-shadow: 0 -2px 0 0 rgba(99, 102, 241, 0.9);
    border-top-color: rgba(99, 102, 241, 0.9);
}

/* Field-drag target: empty-group placeholder lights up */
.cf-fields-empty {
    border: 1px dashed transparent;
    border-radius: 8px;
}
.cf-group:has(.cf-fields-empty) .cf-fields-empty {
    transition: border-color 0.15s;
}

.cf-field-top {
    display: flex; align-items: center; gap: 10px;
}
.cf-field-icon { display: flex; flex-shrink: 0; color: #a5b4fc; }
.cf-field-icon svg { width: 18px; height: 18px; }
.cf-field-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cf-field-name {
    font-size: 0.95rem; font-weight: 600; color: #fff;
    cursor: pointer; transition: color 0.15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-field-name:hover { color: #a5b4fc; }
.cf-field-tech {
    font-size: 0.72rem; color: rgba(255,255,255,0.25); font-family: monospace;
}
.cf-field-type-badge {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(99, 102, 241, 0.1); color: #a5b4fc;
    letter-spacing: 0.03em; white-space: nowrap;
}
.cf-badge { font-size: 0.65rem; padding: 3px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.cf-badge-required { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.cf-badge-system { font-size: 0.75rem; opacity: 0.6; cursor: default; }

/* ── Toggle Switches ── */
.cf-field-toggles {
    display: flex; gap: 12px; margin-top: 10px; padding-left: 40px;
}
.cf-toggle {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none; transition: all 0.15s;
}
.cf-toggle-dot {
    width: 34px; height: 18px; border-radius: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative; transition: all 0.2s;
}
.cf-toggle-dot::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.2s;
}
.cf-toggle-on .cf-toggle-dot {
    background: rgba(99, 102, 241, 0.25); border-color: rgba(99, 102, 241, 0.4);
}
.cf-toggle-on .cf-toggle-dot::after {
    transform: translateX(16px); background: #a5b4fc;
}
.cf-toggle-label {
    font-size: 0.78rem; font-weight: 500;
    color: rgba(255,255,255,0.35);
}
.cf-toggle-on .cf-toggle-label { color: #a5b4fc; }
.cf-toggle:hover .cf-toggle-dot { border-color: rgba(99, 102, 241, 0.3); }

/* ── Empty State ── */
.cf-empty {
    text-align: center; padding: 60px 40px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 16px;
}
.cf-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.cf-empty h3 { color: #fff; margin: 0 0 8px; font-size: 1.1rem; }
.cf-empty p { color: rgba(255,255,255,0.4); margin: 0 0 20px; font-size: 0.88rem; }


/* ═══════════════════════════════════════════════════════
   Add-Field form fields (rendered inside the shared DragModal) +
   `.cf-modal-close` — the small round close button reused by the
   widget palette. (The old .cf-modal* container rules were dropped
   when the dialog moved to DragModal.)
   ═══════════════════════════════════════════════════════ */

.cf-modal-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.cf-modal-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Form fields */
.cf-form-field { margin-bottom: 18px; }
.cf-form-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4); margin-bottom: 8px;
}
.cf-optional { text-transform: none; font-weight: 400; letter-spacing: 0; }

/* Type Grid */
.cf-type-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.cf-type-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 4px; border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.45); cursor: pointer;
    transition: all 0.15s;
}
.cf-type-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: rgba(255,255,255,0.7);
}
.cf-type-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}
.cf-type-btn-icon { display: flex; color: currentColor; }
.cf-type-btn-icon svg { width: 18px; height: 18px; }
.cf-type-btn-label { font-size: 0.6rem; font-weight: 600; white-space: nowrap; }

/* Checkbox */
.cf-checkbox {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem; color: rgba(255,255,255,0.6);
    cursor: pointer;
}
.cf-checkbox input { accent-color: #6366f1; }


/* ── Formel-Felder: Editor-Input + Hinweis + Fehleranzeige ── */
.cf-formula-input {
    font-family: "SF Mono", ui-monospace, Menlo, monospace;
    font-size: 0.8rem; resize: vertical; min-height: 44px;
}
.cf-formula-hint {
    margin: 6px 0 0; font-size: 0.72rem; line-height: 1.45;
    color: var(--text-muted);
}
.cf-form-error {
    margin-top: 10px; padding: 8px 12px; border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5; font-size: 0.78rem; line-height: 1.4;
}
.cf-options-input { resize: vertical; min-height: 60px; }

/* ═══════════════════════════════════════════════════════
   Slide-Out Editor Panel
   ═══════════════════════════════════════════════════════ */

.cf-slide-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 3000;
    animation: overlayFadeIn 0.15s ease;
}
.cf-slide-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 380px; max-width: 90vw;
    background: rgba(15, 18, 40, 0.99);
    border-left: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 3001;
    display: flex; flex-direction: column;
    box-shadow: -16px 0 48px rgba(0,0,0,0.4);
    animation: slideInRight 0.25s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.cf-slide-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cf-slide-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; }
.cf-slide-body { padding: 20px 24px; flex: 1; overflow-y: auto; }
.cf-slide-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.cf-slide-type-info {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; margin-bottom: 20px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
}
.cf-slide-type-icon { display: flex; color: #a5b4fc; }
.cf-slide-type-icon svg { width: 22px; height: 22px; }
.cf-slide-type-name { font-size: 0.9rem; font-weight: 600; color: #a5b4fc; }
.cf-slide-tech { margin-top: 16px; }
.cf-tech-code {
    display: block; margin-top: 6px;
    padding: 8px 12px; font-size: 0.8rem;
    background: rgba(0,0,0,0.3); border-radius: 8px;
    color: rgba(255,255,255,0.5); font-family: monospace;
}


/* ═══════════════════════════════════════════════════════════════════
   Pipeline Admin — 2-Column Layout with Live Preview
   ═══════════════════════════════════════════════════════════════════ */

/* Two-Column Layout (reuses cf- classes for shared styles) */
.pl-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 24px;
    height: calc(100vh - 160px);
}
@media (max-width: 1000px) {
    .pl-layout { grid-template-columns: 1fr; }
    .pl-preview { display: none; }
}
.pl-editor {
    min-width: 0; overflow-y: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.pl-editor::-webkit-scrollbar { display: none; }

.pl-header {
    display: flex; justify-content: space-between; align-items: start;
    margin-bottom: 24px; gap: 16px;
}
.pl-title { font-size: 1.35rem; font-weight: 700; color: #fff; margin: 0; }
.pl-subtitle { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin-top: 4px; }

.pl-create-form {
    display: flex; gap: 10px; margin-bottom: 20px;
    padding: 16px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
}

.pl-list { display: flex; flex-direction: column; gap: 16px; }

/* Pipeline Group (accordion) — reuses cf-group styles */
.pl-group {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; overflow: hidden;
}

/* ── Stage Cards ── */
.pl-stages { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }

.pl-stage-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    cursor: grab; transition: all 0.15s ease;
}
.pl-stage-card:hover { background: rgba(255,255,255,0.04); }
.pl-stage-card.pl-drag-over {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.06);
}

.pl-stage-main {
    display: flex; align-items: center; gap: 10px;
}
.pl-stage-type-icon {
    font-size: 0.85rem; width: 20px; text-align: center;
    color: rgba(255,255,255,0.5);
}
.pl-stage-name {
    flex: 1; font-size: 0.88rem; font-weight: 600; color: #fff;
    cursor: pointer;
}
.pl-stage-name:hover { color: #a5b4fc; }
.pl-stage-name-edit { flex: 1; }
.pl-stage-prob {
    font-size: 0.75rem; color: rgba(255,255,255,0.4);
    font-family: monospace; min-width: 35px; text-align: right;
}

.pl-stage-controls {
    display: flex; align-items: center; gap: 8px;
    padding-left: 30px;
}

/* Color dot input */
.pl-color-dot {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer; padding: 0;
    -webkit-appearance: none; appearance: none;
}
.pl-color-dot::-webkit-color-swatch-wrapper { padding: 0; }
.pl-color-dot::-webkit-color-swatch { border: none; border-radius: 50%; }

/* Probability slider */
.pl-prob-slider {
    flex: 1; max-width: 100px; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.1); border-radius: 2px;
    outline: none;
}
.pl-prob-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: #6366f1; cursor: pointer;
}

/* Stage type select */
.pl-type-mini {
    font-size: 0.7rem; padding: 3px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; color: rgba(255,255,255,0.6);
    outline: none;
}
.pl-type-mini option { background: #1a1d2e; }

/* Empty stages hint */
.pl-empty-stages {
    padding: 16px; text-align: center;
    font-size: 0.82rem; color: rgba(255,255,255,0.3);
}

/* Add stage form */
.pl-add-stage-form {
    padding: 12px 14px;
    background: rgba(99,102,241,0.04);
    border: 1px dashed rgba(99,102,241,0.2);
    border-radius: 10px; margin: 8px 12px 12px;
    display: flex; flex-direction: column; gap: 10px;
}
.pl-add-stage-row { display: flex; gap: 10px; align-items: center; }
.pl-color-input {
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer; padding: 2px;
    -webkit-appearance: none; appearance: none;
}
.pl-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.pl-color-input::-webkit-color-swatch { border: none; border-radius: 6px; }

.pl-prob-input { display: flex; align-items: center; gap: 8px; flex: 1; }
.pl-slider {
    flex: 1; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.1); border-radius: 2px;
}
.pl-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: #6366f1; cursor: pointer;
}
.pl-prob-val {
    font-size: 0.78rem; color: rgba(255,255,255,0.5);
    font-family: monospace; min-width: 32px;
}
.pl-type-select { max-width: 120px; font-size: 0.82rem; }
.pl-add-stage-actions { display: flex; gap: 8px; }

/* ── Preview Panel ── */
.pl-preview {
    display: flex; flex-direction: column;
    max-height: calc(100vh - 160px); overflow: hidden;
}
.pl-preview-scroll {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    padding-bottom: 24px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.pl-preview-scroll::-webkit-scrollbar { display: none; }

.pl-preview-empty {
    padding: 32px; text-align: center;
    font-size: 0.85rem; color: rgba(255,255,255,0.3);
}

/* Pipeline bar preview */
.pl-preview-bar-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px; overflow: hidden;
}
.pl-preview-bar-label {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.3);
    margin-bottom: 12px; font-weight: 600;
}
.pl-preview-bar {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.pl-prev-stage {
    padding: 6px 12px; border-radius: 6px; border: none;
    font-size: 0.72rem; font-weight: 600; cursor: default;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.pl-prev-icon { font-size: 0.65rem; }

/* Conversion Funnel */
.pl-preview-funnel-card, .pl-preview-stats-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 16px;
}
.pl-preview-card-title {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.3);
    margin-bottom: 14px; font-weight: 600;
}
.pl-funnel { display: flex; flex-direction: column; gap: 8px; }
.pl-funnel-row { display: flex; align-items: center; gap: 10px; }
.pl-funnel-bar {
    height: 26px; border-radius: 6px; min-width: 32px;
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0 8px; transition: width 0.4s ease;
}
.pl-funnel-count {
    font-size: 0.7rem; font-weight: 700; color: #fff;
}
.pl-funnel-label {
    font-size: 0.75rem; color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

/* Stats grid */
.pl-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.pl-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
}
.pl-stat-value {
    font-size: 1.1rem; font-weight: 700; color: #fff;
}
.pl-stat-label {
    font-size: 0.65rem; color: rgba(255,255,255,0.35);
    margin-top: 4px; text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ORG CHART — n8n-style Org Canvas (reuses .flow-editor base)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab Bar (Organigramm / Benutzerliste) */
.org-tab-bar { display: flex; gap: 4px; }
.org-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s;
}
.org-tab:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.org-tab-active {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4);
    color: #a5b4fc; font-weight: 600;
}
.org-tab svg { width: 14px; height: 14px; }

/* Org editor overrides — fills the space below the segbar (the injected
   "Benutzer" page-header was removed, so the toolbar sits right under it). */
.org-flow-editor { height: calc(100vh - 140px); }

/* ── Ports — dark fill, accent ring + glow (design: connectable handles) ── */
.org-flow-editor .flow-port {
    fill: var(--bg-primary);
    stroke: var(--accent);
    stroke-width: 2;
    filter: drop-shadow(0 0 5px var(--accent-glow));
    transition: fill var(--transition-fast), r var(--transition-fast);
    cursor: crosshair;
}
.org-flow-editor .flow-port:hover {
    fill: var(--accent);
}

/* ── Wires — muted slate, rounded orthogonal tree connectors (design: .og-wire) ── */
.org-flow-editor .flow-edge {
    fill: none;
    stroke: rgba(148, 163, 184, 0.32);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
    /* The visible line must not swallow clicks — the wide `.flow-edge-hitbox`
       underneath owns the click-to-delete across the full edge width. */
    pointer-events: none;
}
.org-flow-editor .org-edge-dot,
.org-flow-editor .flow-edge-label { pointer-events: none; }
/* Live connecting preview — dashed indigo, same look as the pipeline editor. */
.org-flow-editor .flow-edge-connecting {
    stroke: #6366F1;
    stroke-width: 2;
    stroke-dasharray: 6 3;
    pointer-events: none;
}
.org-flow-editor .flow-edge:hover {
    stroke: rgba(148, 163, 184, 0.55);
}
.org-flow-editor .flow-edge-selected {
    stroke: var(--accent);
    stroke-width: 2.5;
}

/* ── Org Nodes (SVG) ── */
.org-node {
    fill: var(--glass-bg-solid);
    /* Neutral hairline — the type color now lives on the icon tile (design). */
    stroke: rgba(148, 163, 184, 0.16);
    stroke-width: 1.5;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
    transition: stroke 0.18s, filter 0.18s, fill 0.18s;
    cursor: grab;
}
.org-node:hover {
    stroke: var(--glass-border-hover); /* indigo on hover */
    stroke-width: 1.8;
    filter: drop-shadow(0 0 18px var(--accent-glow))
        drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
}
.org-node-selected {
    stroke: var(--success); /* green = selected (design state) */
    stroke-width: 2;
    filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.4));
}
/* Dragging — amber ring + glow (the node group also tilts -1.2deg). */
.org-node-dragging {
    stroke: var(--warning);
    stroke-width: 2;
    filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.4));
}
.org-node-icon {
    font-size: 16px;
    pointer-events: none;
}
.org-node-label {
    font-size: 13px; font-weight: 600;
    fill: #fff; pointer-events: none;
}
.org-node-subtitle {
    font-size: 10px;
    fill: rgba(255,255,255,0.45); pointer-events: none;
}

/* ── Properties Popup (Outlook-style floating card) ── */
.org-popup-overlay {
    position: fixed; inset: 0; z-index: 50;
}
.org-popup {
    position: fixed; z-index: 51;
    width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(20, 24, 48, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 18px;
    display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(99,102,241,0.08);
    animation: org-popup-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.org-popup::-webkit-scrollbar { width: 4px; }
.org-popup::-webkit-scrollbar-track { background: transparent; }
.org-popup::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
@keyframes org-popup-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
/* Drag handle on popup header */
.org-popup-drag-handle {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.org-popup-drag-handle:active { cursor: grabbing; }
.prop-header {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.prop-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    font-size: 18px;
}
.prop-header-info { flex: 1; }
.prop-header-info h4 { font-size: 1rem; font-weight: 600; color: #fff; margin: 0; }
.prop-type { font-size: 0.7rem; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.prop-section { display: flex; flex-direction: column; gap: 6px; }
.prop-label {
    font-size: 0.72rem; color: rgba(255,255,255,0.45);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.prop-input {
    padding: 8px 12px; border-radius: 8px; font-size: 0.85rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: #fff; outline: none; transition: border-color 0.2s;
}
.prop-input:focus { border-color: rgba(99,102,241,0.5); }
.prop-danger { padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; gap: 8px; flex-wrap: wrap; }
.prop-desc { font-size: 0.75rem; color: rgba(255,255,255,0.35); font-style: italic; margin: 0; }

/* ── Status Bar ── */
.org-status-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 16px; font-size: 0.7rem;
    background: rgba(10,12,30,0.85);
    border-top: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.35);
}
.org-status-item { white-space: nowrap; }
.org-status-sep { color: rgba(255,255,255,0.1); }
.org-status-auto { color: rgba(34,197,94,0.6); }

/* ── Minimap ── */
.org-minimap {
    position: absolute; bottom: 36px; right: 12px; z-index: 20;
    width: 160px; height: 100px;
    background: rgba(15,18,38,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.org-minimap-svg { width: 100%; height: 100%; }

/* ── Toast ── */
.org-toast {
    position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%);
    padding: 8px 20px; border-radius: 10px; z-index: 30;
    background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3);
    color: #86efac; font-size: 0.8rem; font-weight: 500;
    backdrop-filter: blur(8px);
    animation: org-toast-in 0.3s ease;
}
@keyframes org-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Context Menu ── */
.org-ctx-backdrop {
    position: fixed; inset: 0; z-index: 100;
}
.org-ctx-menu {
    position: fixed; z-index: 101;
    background: rgba(20,24,48,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 6px;
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    animation: org-ctx-pop 0.15s ease;
}
@keyframes org-ctx-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.org-ctx-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 14px;
    background: transparent; border: none; border-radius: 8px;
    color: rgba(255,255,255,0.8); font-size: 0.83rem;
    cursor: pointer; transition: all 0.15s; text-align: left;
}
.org-ctx-item:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.org-ctx-danger:hover { background: rgba(239,68,68,0.15); color: #f87171; }
/* Draggable grip header of the team context menu. */
.org-ctx-grip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px 8px; margin: 0 0 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.6);
    cursor: move; user-select: none;
}
.org-ctx-grip-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.org-ctx-divider { margin: 4px 8px; border: none; border-top: 1px solid rgba(255,255,255,0.06); }

/* ── Shortcuts Modal ── */
.org-shortcuts-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(20,24,48,0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 28px;
    min-width: 340px; z-index: 200;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: org-ctx-pop 0.2s ease;
}
.org-shortcuts-modal h3 { font-size: 1.1rem; color: #fff; margin: 0 0 16px; }
.org-shortcuts-grid {
    display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
    font-size: 0.82rem; color: rgba(255,255,255,0.7);
}
.org-shortcut-key {
    font-family: monospace; font-size: 0.75rem;
    padding: 2px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    text-align: center;
}

/* ── Node Glow Animation ── */
.org-node-glow {
    animation: org-glow-pulse 2s ease-in-out infinite;
}
@keyframes org-glow-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* ── Edge dot ── */
.org-edge-dot { fill: #6366F1; }

/* ── Palette desc line ── */
.flow-palette-desc {
    font-size: 0.65rem; color: rgba(255,255,255,0.3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


/* Universal 4-side ports: appear on node hover (pipeline-engine feel) */
.org-flow-editor .org-port {
    opacity: 0;
}
.org-flow-editor g:hover > .org-port,
.org-flow-editor .org-port:hover {
    opacity: 1;
}

/* Secondary membership (weitere Zugehörigkeit): display-only, dashed */
.org-flow-editor .org-edge-secondary {
    stroke-dasharray: 6 5;
    opacity: 0.55;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ORG CHART — Glassmorphic Canvas (board.svg Design System)
   Background: #001120 | Panels: Indigo glass @ 52% | Canvas: Black @ 75%
   ═══════════════════════════════════════════════════════════════════════════ */

/* Legacy full-page rule removed: `.org-fullbleed` now lives INSIDE the admin
   window panel (`.ms-win`), so it must NOT zero-out `.app-main`'s padding — that
   made the Benutzer/Organigramm views sit flush against the sidebar + top bar
   (and tinted the inset gutter teal), unlike every other admin section. The
   `.ms-scroll.is-fill` host handles the fill/height now. */
/* No own background: the panels (palette, canvas, tables) float directly on
   the admin window surface — the old #001120 slab read as a stray dark box
   behind Benutzerliste + Organigramm. */
.org-fullbleed {
    display: flex; flex-direction: column;
    height: calc(100vh - 64px);
}
.org-fullbleed .flow-editor {
    flex: 1; min-height: 0; border-radius: 0;
    background: transparent;
}
/* User-list body inside the shared full-bleed host (Benutzerliste tab). */
.aa-userlist-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* No padding — the `.ms-scroll.is-fill` host already insets the content.
       (Padding here double-inset the list, pushing "Benutzer" down + right of
       the org-chart's injected header; removing it aligns the two views.) */
    padding: 0;
}
/* Sections keep their natural height — the BODY scrolls as one unit. Without
   this, the table wrappers (scroll containers via overflow-x) get squeezed to
   a tiny scroll window by a long teams list, hiding the user rows. */
.aa-userlist-body > * { flex-shrink: 0; }

/* ── Editor root — transparent, the admin window provides the surface ── */
.org-flow-editor {
    background: transparent;
}

/* ── Toolbar: invisible layout, no background/border ── */
.org-flow-editor .flow-toolbar {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 10px 20px;
}
.org-flow-editor .flow-toolbar-left {
    display: flex; align-items: center; gap: 12px; flex: 1;
}
.org-flow-editor .flow-toolbar-actions {
    display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.toolbar-undo-group { display: flex; gap: 2px; }
.toolbar-undo-btn {
    padding: 4px 8px; border: none; border-radius: 6px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
    cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.toolbar-undo-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.toolbar-btn-disabled { opacity: 0.3; pointer-events: none; }

/* ── Save Button: glassmorphic rounded box ── */
.org-save-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border-radius: 18px;
    /* Accent fill — matches the primary "+ Neue Rolle" button. */
    background: var(--accent);
    color: #fff;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--accent);
    transition: all 0.2s;
}
.org-save-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}
.org-save-btn svg { width: 16px; height: 16px; }

.org-tab svg {
    width: 16px; height: 16px;
    vertical-align: -3px;
}

/* ── Canvas Node Icons (foreignObject-based SVG) ── */
.org-node-icon-fo { overflow: visible; }
.org-node-icon {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 20px;
    color: rgba(255,255,255,0.85);
}
.org-node-icon svg { width: 16px; height: 16px; }

/* ── Palette Icons (SVG inside buttons) ── */
.flow-palette-icon svg { width: 18px; height: 18px; }

/* ── Context Menu & Button Icons ── */
.org-ctx-item svg, .btn-small svg, .prop-section svg {
    width: 14px; height: 14px;
    vertical-align: -2px;
    opacity: 0.7;
}

/* ── Workspace: invisible layout container, panels float on the window bg ── */
.org-flow-editor .flow-workspace {
    gap: 12px;
    padding: 0 12px 12px;
    background: transparent;
}

/* ── Palette sidebar — opaque dark glass (design: .og-palette) ── */
.org-flow-editor .flow-sidebar {
    width: 244px;
    background: var(--glass-bg-solid);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    border-right: none;
    padding: 18px 0;
}
.org-flow-editor .flow-sidebar-title {
    text-transform: none;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0 18px 2px;
    color: var(--text-primary);
}
.flow-sidebar-subtitle {
    font-size: 0.72rem; color: var(--text-muted);
    margin: 0; padding: 0 18px 14px;
}

/* Section headers (Führung / Struktur / Personen) */
.flow-section-header {
    font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
    letter-spacing: 0.12em; padding: 14px 18px 6px; text-transform: uppercase;
}
.flow-section-header:first-child { padding-top: 4px; }

/* Sidebar scroll */
.org-flow-editor .flow-sidebar-nodes {
    padding: 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.org-flow-editor .flow-sidebar-nodes::-webkit-scrollbar { display: none; }

/* Palette chips — dark input fill, indigo border + slide on hover (design: .og-chip) */
.org-flow-editor .flow-palette-node {
    border-radius: 10px;
    padding: 9px 11px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-left: 1px solid var(--glass-border);
    gap: 11px;
    transition: transform var(--transition-fast),
        border-color var(--transition-fast), background var(--transition-fast);
}
.org-flow-editor .flow-palette-node:hover {
    background: var(--bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateX(3px);
}
/* Coloured icon tile per block type (tinted bg + full-colour glyph set inline). */
.org-flow-editor .flow-palette-icon {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.org-flow-editor .flow-palette-icon svg { width: 16px; height: 16px; }
.org-flow-editor .flow-palette-label { font-size: 0.85rem; font-weight: 500; }

/* Team-block popup: "Team zuweisen" label row with a "+" to create a new team
   (opens the same popup as the Teams page). */
.org-flow-editor .prop-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.org-flow-editor .prop-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: none;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}
.org-flow-editor .prop-add-btn:hover {
    background: var(--accent-hover);
}

/* ── Canvas: indigo glass frame + sunken black interior (board.svg) ── */
.org-flow-editor .flow-canvas {
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
}
.org-flow-editor .flow-canvas svg {
    /* Refined dark surface + single static indigo glow (design: .og-canvas). */
    background:
        radial-gradient(circle at 52% 30%, rgba(99, 102, 241, 0.1), transparent 58%),
        var(--bg-primary);
    border-radius: var(--radius-md);
}

/* ── Status bar (hidden) ── */
.org-status-bar { display: none; }

/* ── Save feedback ── */
.org-flow-editor .save-feedback {
    font-size: 0.72rem; color: rgba(255,255,255,0.35);
    margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ORG CHART — Edge Selection & Deletion
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-edge-hitbox {
    fill: none; stroke: transparent; stroke-width: 16;
    cursor: pointer; pointer-events: stroke;
}
.flow-edge-hitbox:hover ~ .flow-edge {
    opacity: 1; stroke-width: 3;
}
.flow-edge-selected {
    stroke: #EF4444 !important; stroke-width: 3 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 6px rgba(239,68,68,0.5));
}
.org-edge-dot { fill: #6366F1; opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════════════════════
   ORG CHART — User Management (Status dots, User card, Create form)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Status dot text on nodes */
.org-status-text {
    font-size: 8px; fill: rgba(255,255,255,0.5);
    font-family: inherit; pointer-events: none;
}

/* User info card in properties panel */
.org-user-card {
    background: rgba(255,255,255,0.04);
    border-radius: 12px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 8px;
}
.org-user-row {
    display: flex; justify-content: space-between;
    align-items: center; gap: 8px;
}
.org-user-key {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.72rem; color: var(--text-muted);
    white-space: nowrap;
}
.org-user-val {
    display: inline-flex; align-items: center; gap: 7px;
    justify-content: flex-end;
    font-size: 0.78rem; color: var(--text-primary);
    text-align: right; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

/* Inline SVG icon wrapper (brand rule: SVG, never emoji) */
.org-ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; flex-shrink: 0; color: currentColor;
}
.org-ic svg { width: 100%; height: 100%; }

/* Token-based status dot (replaces the old 🟢/🟡/⚪ glyphs) */
.org-status-dot {
    width: 8px; height: 8px; border-radius: var(--radius-full);
    flex-shrink: 0; box-shadow: 0 0 6px currentColor;
}

/* "Verknüpft"-Hinweis with a leading check icon */
.prop-linked {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--success);
}

/* Active/inactive badges */
.org-badge-green {
    font-size: 0.72rem; font-weight: 600;
    color: var(--success); background: rgba(52,211,153,0.12);
    padding: 1px 8px; border-radius: var(--radius-xs, 6px);
}
.org-badge-red {
    font-size: 0.72rem; font-weight: 600;
    color: var(--danger); background: rgba(248,113,113,0.12);
    padding: 1px 8px; border-radius: var(--radius-xs, 6px);
}

/* User info section */
.prop-user-info { border-top: 1px solid rgba(255,255,255,0.06); }
.prop-user-info .btn-small { width: 100%; margin-top: 4px; }

/* Create user section */
.prop-create-user {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
}
.prop-create-user .prop-input {
    margin-bottom: 6px;
}



/* Individual automation card in list */
.automation-list-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: all 0.15s;
}
.automation-list-card:hover {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.2);
}
.automation-list-trigger-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}
.automation-list-nodes-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.45);
}
.automation-list-card-runs {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
}
.automation-toggle-btn.toggle-on {
    background: rgba(20,163,6,0.2);
    border-color: rgba(20,163,6,0.5);
}
.automation-toggle-btn.toggle-off {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}
.toggle-dot-on { background: #4ade80; }
.toggle-dot-off { background: rgba(255,255,255,0.25); }


/* ═══════════════════════════════════════════════════════════════════════════
   FLOW CANVAS — board.svg Design System
   Background: #001120 | Panels: Indigo glass @ 52% | Canvas: Black @ 75%
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fullbleed — fills parent container exactly (no scroll) */
.flow-editor {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    gap: 0; background: transparent; /* admin window provides the surface, like .pc-editor */
    overflow: hidden;
}

/* ── Toolbar: transparent (board.svg) ── */
.flow-toolbar {
    display: flex; align-items: center; gap: 16px; padding: 10px 20px;
    background: transparent; border: none;
    flex-shrink: 0;
}
.flow-back-btn {
    padding: 6px 14px; font-size: 0.8rem; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.2s;
}
.flow-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.flow-title { flex: 1; font-size: 1rem; color: #fff; margin: 0; }
.flow-toolbar-left {
    display: flex; align-items: center; gap: 12px; flex: 1;
}
.flow-toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-red { background: rgba(239,68,68,0.2) !important; border-color: rgba(239,68,68,0.4) !important; color: #f87171 !important; }
.btn-red:hover { background: rgba(239,68,68,0.3) !important; }

/* ── Workspace: board.svg gap layout (must fill remaining space) ── */
.flow-workspace {
    display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative;
    gap: 12px; padding: 0 12px 12px 12px; background: transparent;
}

/* ── Sidebar: Glassmorphic floating panel (board.svg) ── */
.flow-sidebar {
    width: 260px; flex-shrink: 0; display: flex; flex-direction: column;
    /* Same navy glass as the pipeline palette (.pc-palette) */
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.flow-sidebar::-webkit-scrollbar { display: none; }
.flow-sidebar-title {
    font-size: 0.95rem; color: rgba(255,255,255,0.9); margin: 0 20px 2px;
    font-weight: 600; text-transform: none; letter-spacing: 0;
}
.flow-sidebar-tabs { display: flex; gap: 2px; padding: 0 12px; margin-bottom: 10px; }
.flow-tab {
    flex: 1; padding: 5px 4px; font-size: 0.7rem; text-align: center; border-radius: 6px;
    background: transparent; border: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
    cursor: pointer; transition: all 0.2s;
}
.flow-tab:hover { background: rgba(255,255,255,0.06); }
.flow-tab-active { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }

.flow-sidebar-nodes {
    flex: 1; overflow-y: auto; padding: 0 12px;
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.flow-sidebar-nodes::-webkit-scrollbar { display: none; }
.flow-palette-node {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: transparent; border: 1px solid rgba(255,255,255,0.04);
    border-left: none; border-radius: 18px;
    cursor: grab; transition: all 0.2s; color: rgba(255,255,255,0.7); font-size: 0.84rem;
}
.flow-palette-node:active { cursor: grabbing; }
.flow-palette-node:hover {
    background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1);
    color: #fff; transform: translateX(3px);
}
.flow-palette-icon { display: inline-flex; align-items: center; width: 18px; height: 18px; flex-shrink: 0; color: rgba(255,255,255,0.6); }
.flow-palette-icon svg { width: 18px; height: 18px; }
.flow-palette-label { font-size: 0.84rem; color: rgba(255,255,255,0.8); }

.flow-sidebar-hint {
    padding: 10px 20px; margin-top: 8px;
}
.flow-sidebar-hint p { font-size: 0.72rem; color: rgba(255,255,255,0.3); margin: 2px 0; }

/* ── SVG Canvas: indigo glass frame + sunken black interior (board.svg) ── */
.flow-canvas-wrap {
    flex: 1; min-width: 0;
    /* Navy glass frame + sunken near-black-blue interior, like .pc-canvas-wrap */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 14px;
    position: relative;
}
.flow-canvas {
    width: 100%; height: 100%;
    background: rgba(6, 10, 20, 0.75);
    border-radius: 12px;
    cursor: default; user-select: none;
    min-height: 0;
}
.flow-canvas:active { cursor: grabbing; }

/* ── Edges ── */
.flow-edge {
    fill: none; stroke: #6366F1; stroke-width: 2; opacity: 0.7;
    transition: opacity 0.15s;
}
.flow-edge:hover { opacity: 1; stroke-width: 3; }
.flow-edge-preview { stroke-dasharray: 6 4; opacity: 0.5; animation: flowDash 0.6s linear infinite; }
@keyframes flowDash { to { stroke-dashoffset: -10; } }

/* ── Nodes ── */
.flow-node { cursor: grab; transition: filter 0.15s; }
.flow-node:active { cursor: grabbing; }
.flow-node:hover .flow-node-body { filter: brightness(1.15); }
.flow-node-selected .flow-node-body { stroke-width: 3 !important; filter: drop-shadow(0 0 8px rgba(99,102,241,0.5)); }
.flow-node-type { font-family: inherit; letter-spacing: 0.5px; }

/* Status pulse animation for running nodes */
.flow-node-status-pulse {
    animation: status-pulse 1.2s ease-in-out infinite;
}
@keyframes status-pulse {
    0%, 100% { opacity: 1; r: 6; }
    50% { opacity: 0.4; r: 4; }
}

/* foreignObject icon inside SVG nodes — pointer-events:none so clicks pass to rect below */
.flow-node foreignObject { pointer-events: none; }
.flow-node foreignObject .icon-inline { width: 16px; height: 16px; }
.flow-node foreignObject .icon-inline svg { width: 16px; height: 16px; }

/* ── Ports ── */
.flow-port {
    fill: #1e2340; stroke: #6366F1; stroke-width: 2;
    cursor: crosshair; transition: all 0.15s;
}
.flow-port:hover { fill: #6366F1; r: 9; }


/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2: Execution Run Controls & Live Overlay
   ═══════════════════════════════════════════════════════════════════════════ */

/* Run button */
.btn-run {
    padding: 5px 14px; font-size: 0.8rem; border-radius: 8px;
    background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35);
    color: #34d399; cursor: pointer; transition: all 0.2s; font-weight: 600;
}
.btn-run:hover:not(:disabled) { background: rgba(16,185,129,0.25); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.2); }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-running { animation: runPulse 1.5s ease-in-out infinite; }
@keyframes runPulse {
    0%, 100% { border-color: rgba(245,158,11,0.35); color: #fbbf24; }
    50% { border-color: rgba(245,158,11,0.7); box-shadow: 0 0 12px rgba(245,158,11,0.3); }
}

/* Run History Panel — slides in from bottom */
.run-history-panel {
    position: absolute; bottom: 0; left: 220px; right: 0;
    height: 220px; background: rgba(13,16,37,0.97);
    border-top: 1px solid rgba(99,102,241,0.25);
    backdrop-filter: blur(12px);
    display: flex; flex-direction: column;
    z-index: 100;
    animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.run-history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.run-history-title { font-size: 0.85rem; color: rgba(255,255,255,0.7); font-weight: 600; }
.run-history-close {
    background: none; border: none; color: rgba(255,255,255,0.4);
    font-size: 1.2rem; cursor: pointer; padding: 0 4px; line-height: 1;
}
.run-history-close:hover { color: #fff; }
.run-history-list { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 4px; }
.run-history-empty { color: rgba(255,255,255,0.3); font-size: 0.8rem; text-align: center; margin-top: 20px; }
.run-history-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 12px;
    background: rgba(255,255,255,0.03); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem; cursor: pointer; transition: background 0.15s;
}
.run-history-item:hover { background: rgba(99,102,241,0.08); }
.run-status-icon { font-size: 1rem; flex-shrink: 0; }
.run-timestamp { color: rgba(255,255,255,0.6); font-family: monospace; }
.run-duration { color: rgba(255,255,255,0.3); font-size: 0.75rem; }
.run-error { color: #fbbf24; font-size: 0.8rem; }

/* Flow editor parent must be relative for the panel to anchor */
.flow-editor { position: relative; }

/* Status badge animation on running nodes */
@keyframes nodePulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.4)); }
    50% { filter: drop-shadow(0 0 12px rgba(245,158,11,0.8)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INFINITE CANVAS — Grid-Toggle + Zoom Controls
   ═══════════════════════════════════════════════════════════════════════════ */

/* Canvas Controls wrapper (Zoom% + Grid-Toggle) */
.canvas-controls {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 2px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}

/* Zoom reset button */
.canvas-ctrl-btn {
    padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
    background: transparent; border: none;
    color: rgba(255,255,255,0.55); cursor: pointer;
    border-radius: 8px; transition: all 0.15s;
    min-width: 46px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.canvas-ctrl-btn:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* Grid-Toggle group */
.grid-toggle-group {
    display: flex; align-items: center;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding-left: 6px; gap: 2px;
}
.grid-btn {
    width: 26px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent;
    border-radius: 6px; color: rgba(255,255,255,0.35); cursor: pointer;
    font-size: 0.75rem; transition: all 0.15s; font-weight: 700;
}
.grid-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.grid-btn-active {
    background: rgba(99,102,241,0.18);
    border-color: rgba(99,102,241,0.35);
    color: #a5b4fc;
}

/* Make the SVG canvas cursor show panning state */
.flow-canvas:active { cursor: grabbing; }


/* ═══════════════════════════════════════════════════════════════════════════
   NODE PROPERTIES MODAL — Premium floating popup (like admin user modals)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Backdrop — transparent click-catcher, no blur (popover style) */

@keyframes nodePopoverIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sections */
.node-modal-section { margin-bottom: 16px; }
.node-modal-section-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,0.35); font-weight: 600; margin-bottom: 12px;
}
.node-modal-section-title .icon-inline { width: 14px; height: 14px; color: rgba(99,102,241,0.5); }
.node-modal-section-title .icon-inline svg { width: 14px; height: 14px; }

/* Fields */
.node-modal-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.node-modal-field-toggle { flex-direction: row; justify-content: space-between; align-items: center; }
.node-modal-label {
    font-size: 0.8rem; color: rgba(255,255,255,0.6); font-weight: 500;
}
.node-modal-field-hint {
    font-size: 0.72rem; color: rgba(255,255,255,0.25); font-style: italic;
}
.node-modal-input {
    width: 100%; box-sizing: border-box;
    padding: 8px 12px; border-radius: 8px; font-size: 0.85rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: #fff; outline: none; transition: border-color 0.2s;
}
.node-modal-input:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.node-modal-select {
    width: 100%; padding: 9px 12px; font-size: 0.84rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff; outline: none;
    appearance: none; cursor: pointer; font-family: inherit;
}
.node-modal-select:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.node-modal-textarea {
    width: 100%; padding: 9px 12px; font-size: 0.84rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff; outline: none; resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    min-height: 80px; line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.node-modal-textarea:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Toggle */
.node-modal-toggle {
    width: 38px; height: 22px; border-radius: 11px;
    border: 1px solid; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; padding: 0 2px; position: relative;
}
.node-modal-toggle.toggle-on {
    background: rgba(20,163,6,0.2); border-color: rgba(20,163,6,0.5);
    justify-content: flex-end;
}
.node-modal-toggle.toggle-off {
    background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15);
    justify-content: flex-start;
}

/* Arrays */
.node-modal-array-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.node-modal-array-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.15); border-radius: 8px;
}
.node-modal-array-value { flex: 1; font-size: 0.82rem; color: #a5b4fc; }
.node-modal-array-remove {
    width: 20px; height: 20px; border-radius: 6px;
    background: transparent; border: none; color: rgba(255,100,100,0.5);
    cursor: pointer; font-size: 0.7rem; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s;
}
.node-modal-array-remove:hover { color: #ff6464; background: rgba(255,100,100,0.1); }
.node-modal-array-add { display: flex; gap: 6px; }

/* Ports */
.node-modal-ports { display: flex; flex-direction: column; gap: 4px; }
.node-modal-port-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; background: rgba(255,255,255,0.03); border-radius: 8px;
}
.node-modal-port-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #6366F1; flex-shrink: 0;
}
.node-modal-port-label { font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.node-modal-port-id { font-size: 0.72rem; color: rgba(255,255,255,0.25); }

/* Variables */
/* Variables */
.node-modal-vars-list {
    display: flex; flex-wrap: wrap; gap: 5px;
}
.node-modal-var {
    font-size: 0.72rem; padding: 3px 10px; border-radius: 6px;
    background: rgba(99,102,241,0.08); color: rgba(165,180,252,0.7);
    border: 1px solid rgba(99,102,241,0.12); cursor: pointer;
    transition: all 0.15s;
}
.node-modal-var:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.node-modal-hint { font-size: 0.82rem; color: rgba(255,255,255,0.25); margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PALETTE SEARCH — Node search input
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-sidebar-search { padding: 0 10px 8px; }
.flow-search-input {
    width: 100%; padding: 6px 10px; font-size: 0.78rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; color: #fff; outline: none;
    transition: border-color 0.15s;
}
.flow-search-input:focus { border-color: rgba(99,102,241,0.4); }
.flow-search-input::placeholder { color: rgba(255,255,255,0.2); }

.flow-palette-empty {
    padding: 20px 10px; text-align: center;
    color: rgba(255,255,255,0.2); font-size: 0.78rem;
}
.flow-palette-info { display: flex; flex-direction: column; gap: 1px; }
.flow-palette-ports { font-size: 0.65rem; color: rgba(255,255,255,0.3); }

/* ═══════════════════════════════════════════════════════════════════════════
   EXECUTION-AWARE EDGES
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-edge-done { stroke: #10B981; opacity: 0.9; }
.flow-edge-failed { stroke: #EF4444; opacity: 0.9; stroke-dasharray: 8 4; }
.flow-edge-running { stroke: #F59E0B; opacity: 0.9; animation: edgePulse 1.2s ease-in-out infinite; }
@keyframes edgePulse {
    0%, 100% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1; }
}
.flow-edge-label {
    font-family: inherit; pointer-events: none;
}

/* Running node animation */
.flow-node-running .flow-node-body {
    animation: nodeRunPulse 1.5s ease-in-out infinite;
}
@keyframes nodeRunPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(245,158,11,0.7)); }
}

/* Config preview in nodes */
.flow-node-config-preview {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: -0.02em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2: Context Menu, Shortcuts, Undo/Redo, Multi-Select
   ═══════════════════════════════════════════════════════════════════════════ */

/* Editor focus */
.flow-editor:focus { outline: none; }

/* ── Keyboard Shortcuts Overlay ── */
.shortcuts-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    animation: overlayIn 0.15s ease-out;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.shortcuts-modal {
    background: rgba(15,18,40,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 0; width: 400px; max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalIn 0.2s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.shortcuts-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shortcuts-title { font-size: 1rem; font-weight: 600; color: #fff; margin: 0; }
.shortcuts-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 0.9rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.shortcuts-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }
.shortcuts-list { padding: 8px 0; }
.shortcuts-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 20px; transition: background 0.1s;
}
.shortcuts-item:hover { background: rgba(255,255,255,0.03); }
.shortcuts-key {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; padding: 3px 10px; font-size: 0.75rem;
    color: rgba(255,255,255,0.7); font-family: system-ui;
    min-width: 60px; text-align: center;
}
.shortcuts-desc { font-size: 0.82rem; color: rgba(255,255,255,0.5); }

/* ── Multi-Select Highlight ── */
.flow-node-multi-selected .flow-node-body {
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.4));
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 3: Minimap, Node Animations, Node Count Badge
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Minimap ── */
.minimap-container {
    position: absolute; bottom: 16px; right: 16px;
    width: 200px; height: 140px;
    border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,12,30,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    cursor: crosshair; z-index: 50;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.7;
}
.minimap-container:hover {
    opacity: 1; transform: scale(1.02);
    border-color: rgba(99,102,241,0.3);
}
.minimap-svg {
    width: 100%; height: 100%; display: block;
}

/* ── Node Count Badge ── */
.node-count-badge {
    position: absolute; bottom: 16px; left: 16px;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(10,12,30,0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem; color: rgba(255,255,255,0.35);
    letter-spacing: 0.3px; z-index: 50;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── Node Appear Animation ── */
/* NO CSS transform — it overrides SVG transform attribute! */
.flow-node {
    animation: nodeAppear 0.25s ease;
}
@keyframes nodeAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Node hover glow ── */
.flow-node-body {
    transition: filter 0.15s ease;
}
.flow-node:hover .flow-node-body {
    filter: drop-shadow(0 0 6px rgba(99,102,241,0.2));
}

/* ── Edge hover ── */
.flow-edge {
    transition: stroke-opacity 0.15s, stroke-width 0.15s;
    cursor: pointer;
}
.flow-edge:hover {
    stroke-opacity: 1 !important;
    stroke-width: 3px;
    filter: drop-shadow(0 0 4px rgba(99,102,241,0.3));
}

/* ── Connection preview pulse ── */
.flow-edge-preview {
    animation: edgePulse 1s ease infinite;
}
@keyframes edgePulse {
    0%, 100% { stroke-opacity: 0.6; }
    50% { stroke-opacity: 1; }
}

/* ── Ghost button style for toolbar ── */
.btn-ghost {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.5) !important;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.08) !important;
}

/* ── pc-ctx extensions used by the automation context menu ──
   (base .pc-ctx-* chrome lives in _pipeline_canvas_05_menus.css) */
.pc-ctx-divider {
    height: 1px; margin: 4px 8px;
    background: rgba(255,255,255,0.07);
}
.pc-ctx-shortcut {
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    margin-left: 12px;
}
.pc-ctx-disabled { opacity: 0.3; pointer-events: none; }

/* ── Approvals panel (list-page header) ── */
.approvals-popup { width: 380px; }
.approval-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.approval-item:last-child { border-bottom: none; }
.approval-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.approval-item-name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.approval-item-msg { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.approval-item-time { font-size: 0.68rem; color: rgba(255,255,255,0.3); }
.approval-item-actions { display: flex; flex-direction: column; gap: 4px; }
.approval-btn { padding: 4px 10px; font-size: 0.72rem; }

/* Execution inspector */

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 4: Execution Inspector & Timeline
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Execution Inspector Panel ── */
.exec-inspector {
    position: absolute; top: 0; right: -380px;
    width: 360px; height: 100%;
    background: rgba(10,14,35,0.97);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255,255,255,0.06);
    z-index: 80; overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.exec-inspector-open {
    right: 0;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.exec-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky; top: 0;
    background: rgba(10,14,35,0.98); z-index: 2;
}
.exec-header-info { display: flex; align-items: center; gap: 12px; }
.exec-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.exec-header-text { display: flex; flex-direction: column; gap: 2px; }
.exec-title { font-size: 0.9rem; font-weight: 600; color: #fff; margin: 0; }
.exec-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.exec-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Status badge */
.exec-status {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 500; width: fit-content;
}
.exec-status-done { background: rgba(16,185,129,0.15); color: #34D399; }
.exec-status-failed { background: rgba(239,68,68,0.15); color: #F87171; }
.exec-status-running {
    background: rgba(245,158,11,0.15); color: #FBBF24;
    animation: statusPulse 1.5s ease infinite;
}
.exec-status-skipped { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Timing */
.exec-timing {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exec-timing-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); }
.exec-timing-value { font-size: 0.8rem; color: rgba(255,255,255,0.7); font-family: 'JetBrains Mono', monospace; }

/* Sections */
.exec-section { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.exec-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.exec-section-icon { font-size: 0.9rem; }
.exec-section-title { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }

/* Data blocks */
.exec-data-block {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 12px; margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.72rem; color: rgba(255,255,255,0.6);
    line-height: 1.5; overflow-x: auto; white-space: pre-wrap;
    max-height: 200px; overflow-y: auto;
}

/* Error display */
.exec-error-section { background: rgba(239,68,68,0.04); }
.exec-error-msg {
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15);
    border-radius: 8px; padding: 12px; margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: #F87171;
    line-height: 1.5; white-space: pre-wrap;
}

/* Empty state */
.exec-empty { padding: 32px 20px; text-align: center; }
.exec-empty-text { font-size: 0.8rem; color: rgba(255,255,255,0.3); }

/* ── Execution Timeline ── */
.exec-timeline {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 320px; max-height: 280px;
    background: rgba(10,14,35,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    z-index: 90; overflow: hidden;
    animation: tlSlideUp 0.3s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes tlSlideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}
.exec-timeline-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.exec-timeline-title { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.exec-timeline-close {
    width: 24px; height: 24px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: all 0.15s;
}
.exec-timeline-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }
.exec-timeline-list { padding: 8px 0; max-height: 220px; overflow-y: auto; }
.exec-timeline-empty { font-size: 0.78rem; color: rgba(255,255,255,0.3); text-align: center; padding: 16px; }

/* Timeline entries */
.exec-tl-entry {
    display: flex; gap: 12px; padding: 4px 16px; cursor: pointer;
    transition: background 0.1s;
}
.exec-tl-entry:hover { background: rgba(255,255,255,0.03); }
.exec-tl-connector {
    display: flex; flex-direction: column; align-items: center; width: 24px; flex-shrink: 0;
}
.exec-tl-status {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; flex-shrink: 0;
}
.exec-tl-status-done { background: rgba(16,185,129,0.15); }
.exec-tl-status-failed { background: rgba(239,68,68,0.15); }
.exec-tl-status-running { background: rgba(245,158,11,0.15); animation: statusPulse 1.5s ease infinite; }
.exec-tl-line {
    width: 2px; flex: 1; min-height: 12px;
    background: rgba(255,255,255,0.08);
}
.exec-tl-info {
    display: flex; align-items: center; justify-content: space-between;
    flex: 1; min-height: 32px;
}
.exec-tl-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.exec-tl-duration {
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    font-family: 'JetBrains Mono', monospace;
}


/* Dashboard editor & widgets */

/* ═══════════════════════════════════════════════════════════════════════════
   Name prompt — styled in-app replacement for window.prompt
   (create / rename dashboard). Shares the gallery's modalIn/overlayIn motion.
   ═══════════════════════════════════════════════════════════════════════════ */
.np-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    z-index: 3200; display: flex; align-items: center; justify-content: center;
    animation: overlayIn 0.15s ease-out;
}
.np-modal {
    width: 420px; max-width: calc(100vw - 40px);
    background: rgba(12,15,38,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px; padding: 22px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.1);
    animation: modalIn 0.25s cubic-bezier(0.2, 0, 0.13, 1);
    display: flex; flex-direction: column; gap: 16px;
}
.np-header { display: flex; align-items: center; justify-content: space-between; }
.np-title { font-size: 1.05rem; font-weight: 700; color: #fff; }
.np-close {
    width: 30px; height: 30px; border-radius: 9px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.45); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.np-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }
.np-input {
    width: 100%; padding: 11px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; font-size: 0.9rem; outline: none;
    transition: border-color 0.15s;
}
.np-input:focus { border-color: rgba(99,102,241,0.55); }
.np-input::placeholder { color: rgba(255,255,255,0.25); }
.np-actions { display: flex; justify-content: flex-end; gap: 10px; }
.np-btn {
    padding: 9px 18px; border-radius: 10px; cursor: pointer;
    font-size: 0.85rem; font-weight: 600; border: 1px solid transparent;
    transition: all 0.15s;
}
.np-cancel {
    background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
}
.np-cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }
.np-confirm {
    background: var(--accent, #6366f1); color: #fff;
}
.np-confirm:hover { filter: brightness(1.1); }

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 5: Template Gallery
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay */
.tmpl-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
    animation: overlayIn 0.15s ease-out;
}

/* Modal */
.tmpl-modal {
    background: rgba(12,15,38,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px; width: 720px; max-height: 85vh;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.1);
    animation: modalIn 0.25s cubic-bezier(0.2, 0, 0.13, 1);
}

/* Header */
.tmpl-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 24px 28px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tmpl-header-left { display: flex; flex-direction: column; gap: 4px; }
.tmpl-title { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; }
.tmpl-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.tmpl-close {
    width: 32px; height: 32px; border-radius: 10px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.4); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.tmpl-close:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

/* Filters */
.tmpl-filters { padding: 16px 28px; display: flex; flex-direction: column; gap: 12px; }
.tmpl-search {
    width: 100%; padding: 10px 16px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: #fff; font-size: 0.85rem; outline: none;
    transition: border-color 0.15s;
}
.tmpl-search:focus { border-color: rgba(99,102,241,0.4); }
.tmpl-search::placeholder { color: rgba(255,255,255,0.25); }
.tmpl-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.tmpl-cat {
    padding: 5px 14px; border-radius: 20px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); font-size: 0.75rem; cursor: pointer;
    transition: all 0.15s;
}
.tmpl-cat:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.tmpl-cat-active {
    background: rgba(99,102,241,0.15) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: #818CF8 !important;
}

/* Card Grid */
.tmpl-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
    padding: 16px 28px 28px; overflow-y: auto; flex: 1;
}

/* Cards */
.tmpl-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 18px; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0.13, 1);
}
.tmpl-card:hover {
    background: rgba(99,102,241,0.06);
    border-color: rgba(99,102,241,0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.tmpl-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tmpl-card-icon { color: #818cf8; line-height: 0; }
.tmpl-card-icon svg { width: 22px; height: 22px; }
.tmpl-card-name { font-size: 0.88rem; font-weight: 600; color: #fff; margin: 0 0 6px; }
.tmpl-card-desc { font-size: 0.75rem; color: rgba(255,255,255,0.4); line-height: 1.5; margin: 0 0 12px; }
.tmpl-card-meta { display: flex; align-items: center; gap: 10px; }
.tmpl-card-nodes {
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.04); padding: 2px 8px; border-radius: 8px;
}
.tmpl-card-cat {
    font-size: 0.68rem; color: rgba(99,102,241,0.6);
    background: rgba(99,102,241,0.08); padding: 2px 8px; border-radius: 8px;
}

/* Difficulty badges */
.tmpl-diff {
    font-size: 0.62rem; padding: 2px 8px; border-radius: 8px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.tmpl-diff-easy { background: rgba(16,185,129,0.12); color: #34D399; }
.tmpl-diff-medium { background: rgba(245,158,11,0.12); color: #FBBF24; }
.tmpl-diff-hard { background: rgba(139,92,246,0.12); color: #A78BFA; }


/* Additions for the dashboard template gallery (reuses the tmpl-* base) */
.tmpl-use {
    margin-top: 10px;
    width: 100%;
    padding: 7px 0;
    border-radius: 9px;
    border: 1px solid rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.16);
    color: #e0e7ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tmpl-use:hover:not(:disabled) { background: rgba(99,102,241,0.32); }
.tmpl-use:disabled { opacity: 0.4; cursor: not-allowed; }
.tmpl-disabled { opacity: 0.55; }
.tmpl-card-meta { margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 6: Toast Notifications, Status Bar, Production Polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Toast Notifications ── */
.toast-container {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 5000; display: flex; flex-direction: column-reverse;
    gap: 8px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: 12px; min-width: 260px;
    pointer-events: auto; cursor: default;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.2);
    color: #34D399;
}
.toast-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.2);
    color: #F87171;
}
.toast-warning {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.2);
    color: #FBBF24;
}
.toast-info {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    color: #818CF8;
}
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { font-size: 0.8rem; flex: 1; }
.toast-dismiss {
    width: 20px; height: 20px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: none;
    color: rgba(255,255,255,0.3); font-size: 0.65rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; flex-shrink: 0;
}
.toast-dismiss:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.6); }

/* ── Status Bar ── */
.status-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; height: 28px; flex-shrink: 0;
    background: rgba(8,10,28,0.95);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.68rem; color: rgba(255,255,255,0.3);
    letter-spacing: 0.3px;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 4px; }
.sb-item { padding: 0 6px; }
.sb-divider { color: rgba(255,255,255,0.1); padding: 0 2px; }
.sb-zoom { font-family: 'JetBrains Mono', monospace; }
.sb-save { padding: 0 6px; }
.sb-save-idle { color: rgba(255,255,255,0.2); }
.sb-save-saving {
    color: #FBBF24;
    animation: statusPulse 1s ease infinite;
}
.sb-save-saved { color: #34D399; }
.sb-save-error { color: #F87171; }
.sb-autosave { padding: 0 6px; }
.sb-autosave-on { color: rgba(16,185,129,0.5); }
.sb-autosave-off { color: rgba(255,255,255,0.15); }



/* ═══════════════════════════════════════════════════════════════════
   Dashboard Editor — Interactive Canvas with Drag & Drop
   ═══════════════════════════════════════════════════════════════════ */

.dashboard-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Fill the fullbleed (.ms-scroll.is-fill) area rather than a hard 100vh calc
       that overflowed and got clipped. The internal canvas scroll then aligns to
       the visible viewport (toolbar stays fixed, last row reachable). */
    height: 100%;
    min-height: 0;
    padding: 0;
}

/* Propagate the fill down the two generic wrappers ONLY for the dashboard editor
   (scoped via :has so other fullbleed pages are untouched), so .dashboard-editor's
   height:100% resolves against a definite height and its inner scroll works. */
.ms-scroll.is-fill:has(.dashboard-editor) .admin-detail-page,
.ms-scroll.is-fill:has(.dashboard-editor) .admin-detail-content {
    flex: 1;
    min-height: 0;
}

/* ── Toolbar ── */
.de-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    flex-shrink: 0;
}
.de-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.de-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.de-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

/* Grid size controls */
.de-grid-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.de-grid-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.de-grid-btn:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
    color: #818cf8;
}
.de-grid-info {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}
.de-grid-sep {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    padding: 0 2px;
}
.de-widget-count {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

/* Unsaved indicator */
.de-unsaved {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    animation: unsavedPulse 2s ease-in-out infinite;
}
@keyframes unsavedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.de-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.de-btn-add {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.de-btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.de-btn-icon {
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}
.de-btn-icon svg { width: 15px; height: 15px; }
.de-btn-save {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
}
.de-btn-save.active {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.3);
    color: #10b981;
}
.de-btn-save.active:hover {
    background: rgba(16,185,129,0.2);
    box-shadow: 0 2px 12px rgba(16,185,129,0.2);
}

/* ── Error ── */
.de-error {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 13px;
}
.de-error button {
    background: none;
    border: none;
    color: #f87171;
    font-size: 18px;
    cursor: pointer;
}

/* ── Loading ── */
.de-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    color: rgba(255,255,255,0.4);
}
.de-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99,102,241,0.15);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.de-spinner.small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ── Tab bar: switch between named dashboards ── */
.de-tabs {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.de-tabs-readonly { margin-bottom: var(--space-md); }
.de-tab {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 4px 2px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.de-tab:hover { background: rgba(255,255,255,0.05); }
.de-tab.active {
    background: var(--accent); color: #fff;
}
.de-tab.active .de-tab-name { color: #fff; }
.de-tab-name {
    background: none; border: none; cursor: pointer;
    color: inherit; font-weight: 600; font-size: 0.85rem;
    padding: 4px 2px; max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.de-tab-act {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.7;
    font-size: 0.8rem; line-height: 1;
    padding: 3px 5px; border-radius: 5px;
}
.de-tab-act svg { width: 13px; height: 13px; vertical-align: middle; }
.de-tab-act:hover { opacity: 1; background: rgba(0,0,0,0.2); }
.de-tab-del:hover { color: #fecaca; background: rgba(239,68,68,0.35); }
.de-tab-add {
    background: none; border: 1px dashed var(--glass-border); cursor: pointer;
    color: var(--text-secondary); font-size: 1rem; line-height: 1;
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.de-tab-add:hover { color: #fff; border-color: var(--accent); }
.de-tab-addwrap { position: relative; display: inline-flex; }
.de-tab-addmenu {
    position: absolute; top: 100%; left: 0; z-index: 60;
    display: flex; flex-direction: column; min-width: 170px;
    margin-top: 4px; padding: 4px;
    background: #171a2e; border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.de-tab-addmenu button {
    background: none; border: none; cursor: pointer; text-align: left;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    padding: 7px 10px; border-radius: var(--radius-sm); white-space: nowrap;
}
.de-tab-addmenu button:hover { color: #fff; background: rgba(99,102,241,0.25); }

/* ── Admin: widget-catalog control bar (admin Dashboard-Editor only) ── */
.de-admin-bar {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); margin-bottom: var(--space-sm);
}
.de-admin-hint { color: var(--text-secondary); font-size: 0.85rem; flex: 1; }
.de-catalog-open {
    padding: 7px 14px; border-radius: var(--radius-md);
    background: var(--accent); color: #fff; border: none; cursor: pointer;
    font-weight: 600; font-size: 0.85rem; white-space: nowrap;
    transition: background var(--transition-fast);
}
.de-catalog-open:hover { background: var(--accent-hover); }

/* ── Widget-Katalog modal ── */
.de-catalog-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px); z-index: 100;
}
.de-catalog {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(520px, 92vw); max-height: 80vh;
    display: flex; flex-direction: column;
    background: var(--glass-bg-solid); border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    z-index: 101; overflow: hidden;
}
.de-catalog-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--space-md); padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.de-catalog-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.de-catalog-sub { color: var(--text-secondary); font-size: 0.82rem; margin: 4px 0 0; }
.de-catalog-close {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.de-catalog-close:hover { color: var(--text-primary); }
.de-catalog-list { overflow-y: auto; padding: var(--space-sm) var(--space-md); }
.de-catalog-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-md); padding: 10px 8px;
    border-bottom: 1px solid var(--glass-border);
}
.de-catalog-row:last-child { border-bottom: none; }
.de-catalog-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.de-catalog-name { font-weight: 600; font-size: 0.9rem; }
.de-catalog-cat { color: var(--text-secondary); font-size: 0.75rem; }
.de-catalog-switch {
    position: relative; width: 40px; height: 22px; flex-shrink: 0;
    border-radius: 999px; border: none; cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    transition: background var(--transition-fast);
}
.de-catalog-switch.on { background: var(--accent); }
.de-catalog-knob {
    position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff;
    transition: transform var(--transition-fast);
}
.de-catalog-switch.on .de-catalog-knob { transform: translateX(18px); }

/* ── User dashboard: Bearbeiten/Fertig toggle in the topbar ── */
.tb-dash-edit {
    padding: 6px 14px; border-radius: var(--radius-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text-primary); cursor: pointer; font-weight: 600; font-size: 0.82rem;
    transition: all var(--transition-fast);
}
.tb-dash-edit:hover { border-color: var(--accent); }
.tb-dash-edit.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.de-catalog-search {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}
.de-catalog-input {
    flex: 1; padding: 8px 12px; border-radius: var(--radius-md);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 0.85rem;
}
.de-catalog-input:focus { outline: none; border-color: var(--accent); }
.de-catalog-count { color: var(--text-secondary); font-size: 0.75rem; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   Interactive Canvas — THE GRID
   ═══════════════════════════════════════════════════════════════ */

/* Scroll wrapper: the canvas grows to its content height, this parent scrolls.
   We scroll the PARENT (not .de-canvas) because the drag math reads the canvas's
   own bounding rect — scrolling the canvas element would corrupt it. */
.de-canvas-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.de-canvas {
    display: grid;
    gap: 10px;
    padding: 16px;
    /* grow to fill the wrapper when short; keep content height when tall so the
       wrapper scrolls instead of the grid being clipped. */
    flex: 1 0 auto;
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    user-select: none;
    transition: background 0.3s ease;
}
.de-canvas.dragging {
    background: rgba(15,23,42,0.6);
    border-color: rgba(99,102,241,0.15);
}

/* ── Grid cell backgrounds ── */
.de-grid-cell {
    border: 1.5px dashed rgba(255,255,255,0.04);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
    min-height: 120px;
}
.de-grid-cell.empty {
    border-color: rgba(255,255,255,0.06);
}
.de-grid-cell.empty:hover {
    border-color: rgba(99,102,241,0.25);
    background: rgba(99,102,241,0.03);
}
.de-canvas.dragging .de-grid-cell.empty {
    border-color: rgba(99,102,241,0.15);
    background: rgba(99,102,241,0.02);
}

/* Add cell button */
.de-add-cell {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.15);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}
.de-grid-cell.empty:hover .de-add-cell { opacity: 1; }
.de-add-cell:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.4);
    color: #818cf8;
    transform: scale(1.1);
}


/* ═══════════════════════════════════════════════════════════════
   Widgets — Draggable Cards
   ═══════════════════════════════════════════════════════════════ */

.de-widget {
    position: relative;
    /* Same glass surface as the read-only dashboard's .dash-widget — the editor
       must not look like a different product than the dashboard it edits. */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 10;
    min-height: 0;
}
.de-widget:hover {
    border-color: rgba(99,102,241,0.25);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.1);
}
.de-widget.dragging {
    opacity: 0.85;
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 8px 40px rgba(99,102,241,0.2), 0 0 0 2px rgba(99,102,241,0.3);
    z-index: 100;
    transform: scale(1.02);
    cursor: grabbing;
}

/* ── Widget Header (Drag Handle) ── */
.de-widget-header {
    display: flex;
    align-items: center;
    padding: 8px 12px 4px;
    gap: 6px;
    cursor: grab;
}
.de-widget-header:active { cursor: grabbing; }

.de-drag-handle {
    font-size: 12px;
    color: rgba(255,255,255,0.12);
    letter-spacing: 2px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.de-widget:hover .de-drag-handle { color: rgba(99,102,241,0.4); }

.de-widget-title {
    flex: 1;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.de-widget-remove {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(248,113,113,0.08);
    color: #f87171;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
}
.de-widget:hover .de-widget-remove { opacity: 1; }
.de-widget-remove:hover { background: rgba(248,113,113,0.2); transform: scale(1.1); }

/* ── Widget Body ── */
.de-widget-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px 10px;
    min-height: 0;
    overflow: hidden;
}
.de-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ═══════════════════════════════════════════════════════════════
   Resize Handles — Edge & Corner Grips
   ═══════════════════════════════════════════════════════════════ */

.de-resize-e,
.de-resize-s,
.de-resize-se {
    position: absolute;
    z-index: 20;
    transition: opacity 0.15s ease;
    opacity: 0;
}
.de-widget:hover .de-resize-e,
.de-widget:hover .de-resize-s,
.de-widget:hover .de-resize-se {
    opacity: 1;
}

/* Right edge */
.de-resize-e {
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 6px;
    cursor: ew-resize;
    border-radius: 0 4px 4px 0;
}
.de-resize-e::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: rgba(99,102,241,0.4);
    transition: background 0.15s ease;
}
.de-resize-e:hover::after { background: rgba(99,102,241,0.8); }

/* Bottom edge */
.de-resize-s {
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 6px;
    cursor: ns-resize;
    border-radius: 0 0 4px 4px;
}
.de-resize-s::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 20px;
    border-radius: 2px;
    background: rgba(99,102,241,0.4);
    transition: background 0.15s ease;
}
.de-resize-s:hover::after { background: rgba(99,102,241,0.8); }

/* Bottom-right corner */
.de-resize-se {
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    border-radius: 0 0 12px 0;
}
.de-resize-se::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(99,102,241,0.4);
    border-bottom: 2px solid rgba(99,102,241,0.4);
    border-radius: 0 0 3px 0;
    transition: border-color 0.15s ease;
}
.de-resize-se:hover::after {
    border-color: rgba(99,102,241,0.8);
}


/* ═══════════════════════════════════════════════════════════════
   SVG Charts
   ═══════════════════════════════════════════════════════════════ */

.widget-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 0;
    text-align: center;
}
/* Value as a fit-to-box SVG: scales with the card, capped so it never overflows
   nor blows up in a wide box. Replaces the old viewport-relative clamp font. */
.widget-number-svg {
    width: 100%;
    max-height: 86px;
    display: block;
}
.widget-number-text {
    /* font-size is in viewBox user units (viewBox is 110 tall) so the glyphs
       fill the box; the SVG then scales as a whole to the card. */
    font-size: 80px;
    font-weight: 800;
    fill: #d7deff;
    font-family: inherit;
}
.widget-number-unit { font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.widget-number-label { font-size: 11px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.5px; }

/* Chart container — fills the widget card (charts scale WITH the cell). */
.widget-chart {
    width: 100%;
    height: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* The chart SVG is the flexible middle: header + legend keep natural height. */
.widget-chart svg { flex: 1 1 auto; min-height: 0; }

/* ── Pie / Donut SVG ── */
.widget-pie-svg {
    width: 100%;
    max-width: 120px;
    max-height: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.pie-total-value {
    font-size: 18px;
    font-weight: 800;
    fill: rgba(255,255,255,0.85);
    font-family: inherit;
}
.pie-total-label {
    font-size: 7px;
    fill: rgba(255,255,255,0.35);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Pie legend */
.widget-pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}
.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.legend-pct {
    color: rgba(255,255,255,0.3);
    font-variant-numeric: tabular-nums;
}

/* ── Bar SVG ── */
.widget-bar-svg {
    width: 100%;
    max-height: 100px;
    height: auto;
    display: block;
}
.widget-bar-label {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    text-align: center;
}
.bar-rect {
    transition: opacity 0.2s ease;
}
.bar-rect:hover { opacity: 0.8; }

/* ── Line SVG ── */
.widget-line-svg {
    width: 100%;
    max-height: 80px;
    height: auto;
    display: block;
}
.widget-line-label {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Overkill charts — tooltip · axes · value labels · legend · states
   (consumed by the rewritten chart archetypes, Stage B+)
   ═══════════════════════════════════════════════════════════════ */

/* .widget-chart is the positioning anchor for the absolute tooltip. */
.widget-chart { position: relative; }

/* Hover tooltip — glass card, follows the cursor, never intercepts events. */
.chart-tooltip {
    /* fixed → positioned in VIEWPORT coords (anchor offset added in ChartTooltip),
       so the tooltip floats ABOVE the widget and is never clipped by the box's
       overflow:hidden, even when it extends past the box edge. */
    position: fixed;
    pointer-events: none;
    z-index: 200;
    min-width: 64px;
    /* Portal'd onto <body> → free to grow past the widget box; a generous cap
       keeps long series names on one line without wrapping into a tall block. */
    max-width: 340px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(18, 20, 30, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    transition: opacity 0.08s ease;
}
.chart-tt-label { font-weight: 700; color: #fff; white-space: nowrap; }
.chart-tt-value { font-variant-numeric: tabular-nums; }
.chart-tt-muted { color: rgba(255, 255, 255, 0.5); }
.chart-tt-row { display: flex; align-items: center; gap: 6px; }
.chart-tt-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Axis / gridline / value-label primitives (SVG text/line classes). */
.chart-grid-line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis-line { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis-label { fill: rgba(255, 255, 255, 0.45); font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-value-label { fill: rgba(255, 255, 255, 0.85); font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; text-anchor: middle; }
.chart-x-label { fill: rgba(255, 255, 255, 0.45); font-size: 9px; text-anchor: middle; }
.chart-hit { fill: transparent; cursor: pointer; }

/* Legend (multi-series / distribution). */
.chart-legend {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    justify-content: center; margin-top: 6px;
    /* Bei vielen Serien darf die Legende nicht unbegrenzt wachsen und den Chart
       zusammenquetschen: auf ~2 Reihen deckeln, danach in sich scrollen. So
       bleibt die Zeichenfläche groß, egal wie viele Linien/Balken es gibt. */
    max-height: 44px;
    overflow-y: auto;
    flex-shrink: 0;
    width: 100%;
    padding: 0 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.chart-legend::-webkit-scrollbar { width: 6px; height: 6px; }
.chart-legend::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18); border-radius: 3px;
}
.chart-legend-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; color: rgba(255, 255, 255, 0.55); white-space: nowrap;
}
.chart-legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.chart-legend-pct { color: rgba(255, 255, 255, 0.35); }

/* Number card trend chip. */
.chart-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.chart-trend.up { color: var(--chart-pos); }
.chart-trend.down { color: var(--chart-neg); }
.chart-trend.flat { color: rgba(255, 255, 255, 0.4); }

/* Widget states — loading skeleton · empty · error. */
.chart-skeleton {
    width: 70%; height: 60%; border-radius: 8px;
    background: linear-gradient(100deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 70%);
    background-size: 200% 100%;
    animation: chartShimmer 1.3s ease-in-out infinite;
}
@keyframes chartShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.chart-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; color: rgba(255,255,255,0.4); font-size: 11px; text-align: center; }
.chart-state--error { color: var(--chart-neg); }


/* ═══════════════════════════════════════════════════════════════
   Performance analytics — Soll-Ist (goal), Ranking (leaderboard), Funnel
   ═══════════════════════════════════════════════════════════════ */

/* Goal / attainment bar on number cards. */
.chart-goal { width: 70%; max-width: 220px; margin: 6px auto 0; }
.chart-goal-bar {
    height: 6px; border-radius: 3px; overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}
.chart-goal-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.chart-goal-fill.ok   { background: var(--chart-pos); }
.chart-goal-fill.warn { background: var(--warning, #fbbf24); }
.chart-goal-fill.low  { background: var(--chart-neg); }
.chart-goal-text {
    display: block; margin-top: 3px; font-size: 10px;
    color: rgba(255, 255, 255, 0.45); text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Dashed goal line inside SVG charts. */
.chart-goal-line {
    stroke: var(--warning, #fbbf24); stroke-width: 1.2;
    stroke-dasharray: 5 4; opacity: 0.85;
}
.chart-goal-label { fill: var(--warning, #fbbf24); font-size: 8px; font-weight: 700; }

/* Ranking table (leaderboard). */
.rank-chart { justify-content: flex-start; }
.rank-table {
    width: 100%; display: flex; flex-direction: column; gap: 3px;
    overflow-y: auto; min-height: 0; flex: 1 1 auto; padding: 0 6px;
}
.rank-row {
    display: grid;
    grid-template-columns: 22px 8px minmax(0, 1.4fr) auto minmax(30px, 1fr) 34px;
    align-items: center; gap: 7px;
    padding: 4px 6px; border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 11.5px; color: rgba(255, 255, 255, 0.8);
}
.rank-row:hover { background: rgba(255, 255, 255, 0.06); }
.rank-pos { font-weight: 800; color: rgba(255, 255, 255, 0.4); text-align: right; }
.rank-pos.gold   { color: #fbbf24; }
.rank-pos.silver { color: #cbd5e1; }
.rank-pos.bronze { color: #d97706; }
.rank-swatch { width: 8px; height: 8px; border-radius: 2px; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rank-value { font-variant-numeric: tabular-nums; font-weight: 700; color: #fff; white-space: nowrap; }
.rank-bar {
    height: 5px; border-radius: 3px; overflow: hidden;
    background: rgba(255, 255, 255, 0.07);
}
.rank-bar-fill { display: block; height: 100%; border-radius: 3px; }
.rank-share { font-size: 10px; color: rgba(255, 255, 255, 0.4); text-align: right; font-variant-numeric: tabular-nums; }

/* Funnel. */
.funnel-chart { justify-content: flex-start; }
.funnel {
    width: 100%; flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 2px 0;
}
.funnel-bar {
    min-width: 14%; height: 26px; border-radius: 6px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0 10px;
    color: #fff; font-size: 11px; font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.funnel-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-value { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.funnel-pct { opacity: 0.6; font-size: 0.85em; }
.funnel-conv { font-size: 10px; color: rgba(255, 255, 255, 0.45); font-variant-numeric: tabular-nums; }

/* Heatmap — weekday (rows) × hour (cols) intensity grid. */
.heatmap-chart { justify-content: flex-start; }
.heatmap {
    width: 100%; flex: 1 1 auto; min-height: 0;
    display: grid; gap: 2px; align-content: start;
    padding: 2px 4px;
}
.hm-corner { }
.hm-col-head {
    font-size: 8px; color: rgba(255, 255, 255, 0.4);
    text-align: center; overflow: hidden; white-space: nowrap;
}
.hm-row-head {
    font-size: 9px; color: rgba(255, 255, 255, 0.55);
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 4px; font-weight: 600;
}
.hm-cell {
    aspect-ratio: 1 / 1; min-height: 8px; border-radius: 2px;
    transition: outline 0.1s ease;
}
.hm-cell:hover { outline: 1.5px solid rgba(255, 255, 255, 0.6); cursor: default; }
.hm-legend { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 0 4px; }
.hm-legend-label { font-size: 9px; color: rgba(255, 255, 255, 0.45); white-space: nowrap; }
.hm-legend-bar {
    flex: 1; height: 7px; border-radius: 4px; min-width: 40px;
    background: linear-gradient(to right, rgba(99,102,241,0.08), rgba(99,102,241,1));
}

/* ═══════════════════════════════════════════════════════════════
   Sparkline + RAG (conditional formatting) on number cards
   ═══════════════════════════════════════════════════════════════ */

.widget-spark {
    width: 60%;
    max-width: 180px;
    height: 26px;
    display: block;
    margin: 2px auto 0;
    overflow: visible;
}
.widget-spark-line {
    stroke: var(--chart-cat-1);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.widget-spark-area {
    fill: rgba(99,102,241,0.14);
}

/* Number RAG colouring: alert breach / Soll-Ist attainment */
.widget-number-text.rag-ok   { fill: #34d399; }
.widget-number-text.rag-warn { fill: #fbbf24; }
.widget-number-text.rag-low  { fill: #f87171; }

/* Cross-filter enabled: segments advertise their clickability */
.xf-on .chart-hit,
.xf-on .chart-legend-item,
.xf-on .rank-row,
.xf-on .funnel-bar {
    cursor: pointer;
}
.xf-on .chart-legend-item:hover {
    color: rgba(255,255,255,0.9);
}
.xf-on .rank-row:hover {
    background: rgba(99,102,241,0.08);
}

/* Goal pacing chip on number cards ("Tempo: … % vom Ziel") */
.chart-pacing {
    font-size: 10.5px;
    color: rgba(255,255,255,0.5);
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 999px;
    padding: 2px 10px;
    margin-top: 4px;
    white-space: nowrap;
}

/* Forecast legend swatch: dashed look */
.chart-legend-fc {
    background: repeating-linear-gradient(90deg,
        var(--chart-cat-1) 0 4px, transparent 4px 7px) !important;
}

/* ── Team matrix: Mitarbeiter × KPI table with RAG cells ── */
.matrix-chart { overflow: auto; align-items: stretch; }
.matrix {
    display: grid;
    width: 100%;
    gap: 3px;
    align-content: start;
}
.matrix-corner, .matrix-head {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.4);
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.matrix-head { text-align: right; }
.matrix-user {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(255,255,255,0.03);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xf-on .matrix-user { cursor: pointer; }
.xf-on .matrix-user:hover { background: rgba(99,102,241,0.16); color: #fff; }
.matrix-cell {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.matrix-cell.ok   { color: #34d399; background: rgba(52,211,153,0.08); }
.matrix-cell.warn { color: #fbbf24; background: rgba(251,191,36,0.08); }
.matrix-cell.low  { color: #f87171; background: rgba(248,113,113,0.08); }

/* Builder: matrix column rows (chip + target input) */
.wb-matrix-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.wb-matrix-target { max-width: 130px; margin: 0; padding: 5px 8px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   Widget Creator Modal
   ═══════════════════════════════════════════════════════════════ */

.wc-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.wc-modal {
    background: linear-gradient(165deg, rgba(30,41,59,0.98), rgba(15,23,42,0.99));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    width: min(600px, 90vw);
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.wc-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wc-header h3 { margin: 0; font-size: 16px; color: rgba(255,255,255,0.9); }
.wc-close-btn {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.4); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.wc-close-btn:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.2); color: #f87171; }

.wc-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.wc-categories { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-cat-btn {
    padding: 5px 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    font-size: 11px; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease; text-transform: capitalize;
}
.wc-cat-btn.active, .wc-cat-btn:hover {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #818cf8;
}

.wc-search {
    width: 100%; padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; color: rgba(255,255,255,0.85); font-size: 13px;
    outline: none; transition: border-color 0.2s ease;
}
.wc-search:focus { border-color: rgba(99,102,241,0.4); }
.wc-search::placeholder { color: rgba(255,255,255,0.2); }

.wc-kpi-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding-right: 4px; }
.wc-kpi-item {
    width: 100%; padding: 10px 14px; border-radius: 10px;
    border: 1px solid transparent; background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
    text-align: left; transition: all 0.15s ease;
    display: flex; align-items: center; gap: 10px;
}
.wc-kpi-item:hover { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.15); }
.wc-kpi-item.selected { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); color: #e0e7ff; }
.wc-kpi-icon { font-size: 16px; flex-shrink: 0; }
.wc-kpi-meta { flex: 1; }
.wc-kpi-name { font-weight: 600; }
.wc-kpi-desc { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 2px; }

.wc-config { padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 12px; }
.wc-config-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }

.wc-display-types, .wc-time-ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-dt-btn, .wc-tr-btn {
    padding: 6px 14px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease;
}
.wc-dt-btn.active, .wc-dt-btn:hover,
.wc-tr-btn.active, .wc-tr-btn:hover {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #818cf8;
}

.wc-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.06); }
.wc-cancel-btn {
    padding: 8px 18px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5); font-size: 13px; cursor: pointer;
    transition: all 0.15s ease;
}
.wc-cancel-btn:hover { background: rgba(255,255,255,0.06); }
.wc-create-btn {
    padding: 8px 22px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
    transition: all 0.15s ease;
}
.wc-create-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.wc-create-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.wc-empty-config { padding: 20px; text-align: center; color: rgba(255,255,255,0.3); }
.wc-empty-icon { font-size: 32px; }
.wc-empty-config p { font-size: 13px; margin: 0; }


/* ═══════════════════════════════════════════════════════════════
   Dashboard Page — Read-only Widget Grid
   ═══════════════════════════════════════════════════════════════ */

.dash-widget-grid {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    min-height: 300px;
}

.dash-widget {
    /* Same glass surface as the Kundenprofil cards (.cp-box) — one look. */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    animation: dashWidgetIn 0.4s ease backwards;
}
.dash-widget:hover {
    border-color: rgba(99,102,241,0.15);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(99,102,241,0.06);
    transform: translateY(-2px);
}
@keyframes dashWidgetIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stagger animation delay for each widget */
.dash-widget:nth-child(1)  { animation-delay: 0.0s; }
.dash-widget:nth-child(2)  { animation-delay: 0.05s; }
.dash-widget:nth-child(3)  { animation-delay: 0.10s; }
.dash-widget:nth-child(4)  { animation-delay: 0.15s; }
.dash-widget:nth-child(5)  { animation-delay: 0.20s; }
.dash-widget:nth-child(6)  { animation-delay: 0.25s; }
.dash-widget:nth-child(7)  { animation-delay: 0.30s; }
.dash-widget:nth-child(8)  { animation-delay: 0.35s; }
.dash-widget:nth-child(9)  { animation-delay: 0.40s; }
.dash-widget:nth-child(10) { animation-delay: 0.45s; }
.dash-widget:nth-child(11) { animation-delay: 0.50s; }
.dash-widget:nth-child(12) { animation-delay: 0.55s; }

.dash-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 6px;
}
.dash-widget-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-widget-range {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    padding: 2px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    flex-shrink: 0;
}

.dash-widget-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Slim gutters: the chart, not the padding, gets the box. */
    padding: 2px 10px 10px;
    min-height: 100px;
    overflow: hidden;
}

.dash-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

/* ── Empty dashboard hint ── */
.dash-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    margin-top: 20px;
    background: rgba(15,23,42,0.4);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 16px;
    text-align: center;
}
.dash-empty-icon {
    color: rgba(255, 255, 255, 0.28);
    margin-bottom: 12px;
    line-height: 0;
}
.dash-empty-hint p {
    margin: 0;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}
.dash-empty-sub {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: rgba(255,255,255,0.25) !important;
}
.dash-editor-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
}
.dash-editor-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.dash-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    margin-top: 20px;
}

/* ── Live indicator dot (pulses green when WS connected) ── */
.dash-live-dot {
    color: #22c55e;
    font-size: 10px;
    margin-left: 8px;
    animation: live-pulse 2s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}


/* ═══════════════════════════════════════════════════════════════
   Global Filter Bar — date/team override + cross-filter chip
   ═══════════════════════════════════════════════════════════════ */

.dash-gfilter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    background: linear-gradient(145deg, rgba(30,41,59,0.7), rgba(15,23,42,0.8));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
}
.dash-gfilter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.45);
    padding-right: 4px;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.dash-gfilter-ranges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.dash-gfilter-daterow {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-gfilter-team {
    max-width: 220px;
    margin: 0;
}
.dash-gfilter-xchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.18);
    color: #c7d2fe;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-gfilter-xchip:hover {
    background: rgba(99,102,241,0.3);
    border-color: rgba(99,102,241,0.7);
}
.dash-gfilter-x { font-weight: 800; opacity: 0.8; }
.dash-gfilter-spacer { flex: 1; }
.dash-gfilter-reset {
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.dash-gfilter-reset:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}
.dash-gfilter-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.28);
}

/* Per-widget CSV export button (read-only header) */
.dash-widget-csv {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.dash-widget-csv:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(99,102,241,0.15);
}

/* ═══════════════════════════════════════════════════════════════
   Cockpit mode — the read-only dashboard fills the viewport,
   the 4×3 grid NEVER scrolls. (Pattern like .app-main:has(.cal-grid).)
   ═══════════════════════════════════════════════════════════════ */

.app-main:has(> .dash-cockpit),
.app-main.dash-fill {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    scrollbar-gutter: auto;
    /* Trim the top padding (default var(--space-md)) → less dead space above the
       cockpit bar; the reclaimed height flows into the grid, so every widget box
       gets taller. Sides/bottom keep the normal gutter. */
    padding-top: 4px;
}
.dash-cockpit {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Belt-and-braces: if neither the .dash-fill class nor :has() applied
       (unknown webview), still stretch to roughly the viewport so the grid
       rows never collapse to content height. Harmless when flexed. */
    min-height: calc(100vh - 170px);
}
.dash-cockpit .dash-widget-grid {
    flex: 1;
    min-height: 0;
    margin-top: 4px;
    /* Widgets accidentally placed below the configured rows still fit:
       implicit rows share the height instead of adding scroll. */
    grid-auto-rows: minmax(0, 1fr);
}
.dash-cockpit .dash-loading { flex: 1; }

/* ── The slim cockpit bar: dashboard picker + compact filters ── */
.dash-cockpit-bar {
    display: flex;
    align-items: center;
    /* nowrap: the dashboard pills scroll horizontally instead of wrapping, so
       many dashboards never push the global filters onto a second row. */
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    flex: 0 0 auto;
}
.dash-dashsel {
    display: flex;
    align-items: center;
    gap: 6px;
    /* Horizontal-scroll strip: keep the tabs on ONE line and shrink (not wrap)
       when they overflow — the strip scrolls, the filters stay in place. */
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox — slim/hidden strip, scroll via trackpad */
}
.dash-dashsel::-webkit-scrollbar {
    display: none; /* WebKit */
}
.dash-dashsel-pill {
    flex-shrink: 0; /* pills keep full size; the strip scrolls instead */
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.dash-dashsel-pill:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}
.dash-dashsel-pill.active {
    background: rgba(99,102,241,0.22);
    border-color: rgba(99,102,241,0.5);
    color: #e0e7ff;
}
.dash-cockpit-sel {
    margin: 0;
    width: auto;
    max-width: 190px;
    padding: 5px 8px;
    font-size: 12px;
    flex-shrink: 0; /* filters keep their size — the pills strip scrolls instead */
}
.dash-cockpit-date {
    margin: 0;
    width: auto;
    padding: 4px 6px;
    font-size: 12px;
}

/* ── Per-widget ⋯ menu (export etc. hidden behind a click) ── */
.dash-widget-menu-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.dash-widget-menu-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(99,102,241,0.15);
}
.dash-widget-menu {
    position: absolute;
    top: 32px;
    right: 8px;
    z-index: 40;
    min-width: 190px;
    padding: 4px;
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.dash-widget-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: rgba(255,255,255,0.75);
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.dash-widget-menu-item:hover {
    background: rgba(99,102,241,0.18);
    color: #fff;
}

/* "Mehr laden" at the end of a capped drill-down list. */
.dash-drilldown-more {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    color: var(--accent, #a5b4fc);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.dash-drilldown-more:hover { background: rgba(99, 102, 241, 0.16); }
.dash-drilldown-more:disabled { opacity: 0.6; cursor: default; }

/* ═══════════════════════════════════════════════════════════════
   Clickable Widget Cursor
   ═══════════════════════════════════════════════════════════════ */

.dash-widget-clickable { cursor: pointer; transition: all 0.2s; }
.dash-widget-clickable:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.de-widget-clickable { cursor: pointer; }
.de-widget-clickable:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   Drill-Down Overlay (Dashboard Live View)
   ═══════════════════════════════════════════════════════════════ */

.dash-drilldown-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    animation: overlayFadeIn 0.15s ease;
}

.dash-drilldown-overlay {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 420px; max-width: 90vw;
    max-height: 65vh;
    background: rgba(15, 18, 40, 0.98);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    z-index: 1001;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.04),
                0 0 80px rgba(99, 102, 241, 0.08);
    animation: drillPopIn 0.25s cubic-bezier(0.2, 0, 0.13, 1);
    overflow: hidden;
}
@keyframes drillPopIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dash-drilldown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.dash-drilldown-title {
    font-size: 1.1rem; font-weight: 700; color: #fff;
    margin: 0; letter-spacing: -0.01em;
}
.dash-drilldown-close {
    width: 32px; height: 32px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.06); border: none;
    color: rgba(255, 255, 255, 0.5); font-size: 1.2rem;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s;
}
.dash-drilldown-close:hover {
    background: rgba(255, 100, 100, 0.15); color: #ff6464;
}

.dash-drilldown-body {
    flex: 1; overflow-y: auto; padding: 0 28px 20px;
}

.dash-drilldown-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 40px; color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}
.dash-drilldown-empty {
    text-align: center; padding: 40px; color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}
.dash-drilldown-count {
    font-size: 0.75rem; color: rgba(255, 255, 255, 0.35);
    padding: 12px 0 8px; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600;
}

.dash-drilldown-list {
    display: flex; flex-direction: column; gap: 4px;
}
.dash-drilldown-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none; color: inherit;
    transition: all 0.15s;
    cursor: pointer;
}
.dash-drilldown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateX(4px);
}

.dash-drilldown-item-avatar {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    color: #a5b4fc;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700;
    flex-shrink: 0;
}
.dash-drilldown-item-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.dash-drilldown-item-name {
    font-size: 0.9rem; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-drilldown-item-sub {
    font-size: 0.78rem; color: rgba(255, 255, 255, 0.4);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-drilldown-item-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1rem; flex-shrink: 0;
    transition: color 0.15s;
}
.dash-drilldown-item:hover .dash-drilldown-item-arrow {
    color: rgba(99, 102, 241, 0.8);
}


/* Drill-down context chip (team / cross-filter segment applied to the list) */
.dash-drilldown-ctx {
    margin-left: auto;
    margin-right: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99,102,241,0.35);
    background: rgba(99,102,241,0.14);
    color: #c7d2fe;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

/* ═══════════════════════════════════════════════════════════════
   Widget Edit Modal (Dashboard Editor)
   ═══════════════════════════════════════════════════════════════ */

.de-edit-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
}
.de-edit-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 440px; max-width: 90vw;
    background: rgba(15, 18, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    z-index: 2001;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
                0 0 1px rgba(255, 255, 255, 0.1);
    animation: editModalIn 0.25s cubic-bezier(0.2, 0, 0.13, 1);
    display: flex; flex-direction: column;
}
@keyframes editModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.de-edit-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.de-edit-title {
    font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0;
}
.de-edit-close {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.06); border: none;
    color: rgba(255, 255, 255, 0.4); font-size: 1rem;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s;
}
.de-edit-close:hover {
    background: rgba(255, 100, 100, 0.15); color: #ff6464;
}

.de-edit-body { padding: 20px 24px; }

.de-edit-field { margin-bottom: 20px; }
.de-edit-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4); margin-bottom: 8px;
}
.de-edit-kpi-name {
    font-size: 0.95rem; font-weight: 600; color: #a5b4fc;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
}

.de-edit-type-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.de-edit-type-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer; transition: all 0.15s;
}
.de-edit-type-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: rgba(255, 255, 255, 0.8);
}
.de-edit-type-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}
.de-edit-type-icon { font-size: 1.3rem; }
.de-edit-type-label { font-size: 0.7rem; font-weight: 600; }

.de-edit-range-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.de-edit-range-btn {
    padding: 8px 6px; font-size: 0.78rem; font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer; transition: all 0.15s;
    text-align: center;
}
.de-edit-range-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}
.de-edit-range-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

.de-edit-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.de-btn-cancel {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.6) !important;
}
.de-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* ── Team Scope Picker ── */
.de-edit-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.de-edit-select:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}
.de-edit-select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px;
}
.de-edit-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin: 2px 0 8px;
    line-height: 1.4;
}

/* ── Team Badge on Widget Header ── */
.de-team-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    flex-shrink: 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
}


/* ── Schwellwert-Alarm row: op toggle + threshold input side by side ── */
.de-edit-alert-row {
    display: flex; gap: 8px; align-items: stretch;
}
.de-edit-alert-op {
    flex: 1; grid-template-columns: repeat(2, 1fr);
}
.de-edit-alert-val {
    max-width: 170px; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Widget Builder — unified guided create/edit flow (.wb-* family)
   Two panes: left rail (config, progressive disclosure) + right (live preview).
   ═══════════════════════════════════════════════════════════════════ */

.wb-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(3, 7, 18, 0.6); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.wb-modal {
    width: min(940px, 95vw); max-height: 90vh;
    display: flex; flex-direction: column;
    background: var(--glass-bg-solid, #0f172a);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
    border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
/* Command builder: FIXED height so the modal never pumps when the dropdown,
   the autosizing textarea, the advisory line or the examples appear/disappear —
   the rail scrolls internally instead. */
.wb-modal-cmd { height: min(720px, 90vh); }
.wb-modal-cmd .wb-preview-card { min-height: 300px; }

/* ── Header ── */
.wb-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.wb-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: rgba(255,255,255,0.92); }
.wb-close {
    background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px;
}
.wb-close:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ── Two-pane shell ── */
.wb-shell {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    flex: 1; min-height: 0;
}
.wb-rail {
    padding: 18px 20px; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 18px;
}
.wb-preview {
    padding: 18px 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    background: rgba(255,255,255,0.015);
}

/* ── Steps (Daten / Darstellung / Präzisieren) ── */
.wb-step { display: flex; flex-direction: column; gap: 10px; }
.wb-step-head { display: flex; align-items: center; gap: 8px; }
.wb-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(99,102,241,0.18); color: #a5b4fc;
    font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.wb-step-title { font-size: 0.9rem; font-weight: 700; color: rgba(255,255,255,0.9); }
.wb-step-value {
    margin-left: auto; font-size: 0.8rem; font-weight: 600; color: #a5b4fc;
    max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-step-hint { margin-left: auto; font-size: 0.72rem; color: rgba(255,255,255,0.35); }
.wb-link {
    margin-left: 8px; background: none; border: none; cursor: pointer;
    color: #a5b4fc; font-size: 0.78rem; text-decoration: underline; padding: 0;
}

/* ── KPI picker ── */
.wb-search {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px; color: #fff; font-size: 0.85rem;
}
.wb-search:focus { outline: none; border-color: rgba(99,102,241,0.5); }
.wb-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-cat {
    padding: 5px 10px; font-size: 0.75rem; border-radius: 999px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
}
.wb-cat:hover { background: rgba(99,102,241,0.12); }
.wb-cat.active { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); color: #c7d2fe; }
.wb-kpi-list {
    display: flex; flex-direction: column; gap: 6px;
    /* Use the modal's available height instead of a hard 260px cap — the old
       cap cut the list mid-item while the rail below stayed empty. */
    max-height: min(48vh, 520px);
    overflow-y: auto; padding-right: 4px;
    scrollbar-width: thin;
}
.wb-kpi-list::-webkit-scrollbar { width: 6px; }
.wb-kpi-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14); border-radius: 3px;
}
.wb-kpi-item {
    display: flex; align-items: center; gap: 10px; text-align: left;
    padding: 9px 11px; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.wb-kpi-item:hover { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.25); }
.wb-kpi-item.selected { background: rgba(99,102,241,0.16); border-color: rgba(99,102,241,0.45); }
.wb-kpi-meta { flex: 1; min-width: 0; }
.wb-kpi-name { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.wb-kpi-desc { font-size: 0.74rem; color: rgba(255,255,255,0.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-kpi-type { font-size: 0.68rem; color: rgba(255,255,255,0.4); flex-shrink: 0; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,0.05); }
/* Pencil to edit a custom KPI's spec — subtle, brightens on hover (SVG icon). */
.wb-kpi-edit { flex-shrink: 0; margin-left: 4px; padding: 4px 6px; border-radius: 6px; cursor: pointer; line-height: 0; display: inline-flex; align-items: center; opacity: 0.5; transition: opacity 0.12s ease, background 0.12s ease; }
.wb-kpi-edit:hover { opacity: 1; background: rgba(99,102,241,0.18); }
.wb-kpi-edit svg { display: block; }
/* "Schema"-edit button in the ① Daten head: icon + label on one line. */
.wb-schema-edit { display: inline-flex; align-items: center; gap: 4px; }
.wb-schema-edit svg { display: block; }
.wb-kpi-empty { padding: 16px; text-align: center; color: rgba(255,255,255,0.4); font-size: 0.82rem; }
/* The two "create / define custom KPI" CTAs sit side-by-side to use the width. */
.wb-kpi-new-row { display: flex; gap: 8px; margin-bottom: 8px; }
.wb-kpi-new {
    flex: 1 1 0; min-width: 0; margin: 0;
    background: rgba(16,185,129,0.1); border: 1px dashed rgba(16,185,129,0.4);
}
.wb-kpi-new:hover { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.6); }
.wb-kpi-new .wb-kpi-name { color: #6ee7b7; }

/* ── Display type tiles ── */
.wb-dt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wb-dt {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6); transition: all 0.15s;
}
.wb-dt:hover { background: rgba(99,102,241,0.1); }
.wb-dt.active { background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.5); color: #c7d2fe; }
/* Not recommended for the current data — muted but still fully clickable. */
.wb-dt.dimmed { opacity: 0.55; }
.wb-dt.dimmed:hover { opacity: 0.9; }
.wb-dt-icon { display: inline-flex; align-items: center; justify-content: center; height: 24px; }
.wb-dt-icon svg { width: 22px; height: 22px; display: block; }
.wb-dt-label { font-size: 0.72rem; font-weight: 500; }
.wb-dt-badge {
    position: absolute; top: -6px; right: -4px;
    font-size: 0.58rem; font-weight: 700; padding: 1px 5px; border-radius: 999px;
    background: #6366f1; color: #fff;
}
.wb-hint {
    margin-top: 4px; padding: 8px 11px; border-radius: 9px;
    font-size: 0.76rem; line-height: 1.35;
    color: #fcd34d; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25);
}

/* ── Accordion (Präzisieren) ── */
.wb-acc { border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.wb-acc.open { border-color: rgba(99,102,241,0.3); }
.wb-acc-head {
    width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
    padding: 10px 12px; cursor: pointer; background: rgba(255,255,255,0.02); border: none; color: inherit;
}
.wb-acc-head:hover { background: rgba(255,255,255,0.04); }
.wb-acc-caret { color: rgba(255,255,255,0.4); font-size: 0.7rem; width: 12px; }
.wb-acc-label { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.wb-acc-summary {
    margin-left: auto; font-size: 0.76rem; color: rgba(255,255,255,0.45);
    max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-acc-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255,255,255,0.05); }
.wb-sub-label { font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Chips + selects (shared inside accordion) ── */
.wb-chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-chip {
    padding: 6px 11px; font-size: 0.76rem; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
}
.wb-chip:hover { background: rgba(99,102,241,0.1); }
.wb-chip.active { background: rgba(99,102,241,0.16); border-color: rgba(99,102,241,0.4); color: #c7d2fe; }
.wb-select {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px; color: #fff; font-size: 0.82rem;
}
.wb-select:focus { outline: none; border-color: rgba(99,102,241,0.5); }
.wb-select option { background: #0f172a; }
.wb-daterow { display: flex; align-items: center; gap: 8px; }
.wb-date { flex: 1; min-width: 0; }
.wb-date-sep { font-size: 0.78rem; color: rgba(255,255,255,0.45); flex-shrink: 0; }
.wb-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.wb-toggle input {
    accent-color: var(--accent, #6366f1);
    /* Without this the UNCHECKED box renders white (accent-color only tints
       the checked state) — a bright square in the dark UI. */
    color-scheme: dark;
    width: 15px; height: 15px;
}
.wb-alert-row { display: flex; gap: 8px; align-items: stretch; }
.wb-alert-op { flex: 1; }
.wb-alert-val { max-width: 170px; flex-shrink: 0; }

/* ── Kombinieren: mini KPI picker + hints ── */
.wb-acc-hint {
    margin: 0; font-size: 0.75rem; line-height: 1.4;
    color: rgba(255,255,255,0.5);
}
.wb-combine-list {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 170px; overflow-y: auto;
}
.wb-combine-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    text-align: left; padding: 7px 10px; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.8); font-size: 0.8rem;
}
.wb-combine-item:hover { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); }
.wb-combine-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Target suggestion chips ── */
.wb-suggest { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wb-suggest-label { font-size: 0.74rem; color: rgba(255,255,255,0.45); }
.wb-suggest-chip {
    padding: 4px 9px; font-size: 0.74rem; border-radius: 999px; cursor: pointer;
    background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7;
}
.wb-suggest-chip:hover { background: rgba(16,185,129,0.22); }

/* ── Live preview pane ── */
.wb-preview-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.4); }
/* Herkunfts-Zeile unter der Vorschau: „Zeigt: Anzahl Deals · je … · letzte 30 Tage". */
.wb-preview-source {
    margin-top: 8px; font-size: 0.78rem; line-height: 1.35;
    color: rgba(255,255,255,0.62);
}
.wb-preview-source-key { color: rgba(255,255,255,0.4); font-weight: 600; }
.wb-preview-card {
    min-height: 220px; border-radius: 14px; padding: 14px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    display: flex; flex-direction: column;
}
.wb-preview-empty {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.35); font-size: 0.85rem; text-align: center;
}
.wb-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wb-metric { font-size: 0.78rem; color: rgba(255,255,255,0.6); }
.wb-metric.strong { font-weight: 700; color: rgba(255,255,255,0.9); }
.wb-pill { font-size: 0.74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.wb-pill.breach { background: rgba(239,68,68,0.18); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.wb-pill.ok { background: rgba(16,185,129,0.14); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }

/* ── Footer ── */
.wb-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.wb-cancel {
    padding: 9px 18px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
}
.wb-cancel:hover { background: rgba(255,255,255,0.1); }
.wb-submit {
    padding: 9px 20px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 0.85rem;
    background: var(--accent, #6366f1); border: none; color: #fff;
}
.wb-submit:hover:not(:disabled) { background: var(--accent-hover, #4f46e5); }
.wb-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Responsive: stack the preview under the rail on narrow screens ── */
@media (max-width: 880px) {
    .wb-shell { grid-template-columns: 1fr; }
    .wb-rail { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .wb-preview-card { min-height: 160px; }
}

/* ── Focus rings: no native white outlines inside the modal (Safari shows
   them on every click) — a subtle accent ring for keyboard users instead. ── */
.wb-modal button:focus,
.wb-modal input:focus,
.wb-modal select:focus,
.tmpl-modal button:focus {
    outline: none;
}
.wb-modal button:focus-visible,
.tmpl-modal button:focus-visible {
    outline: 2px solid rgba(99,102,241,0.55);
    outline-offset: 1px;
}
.wb-modal input:focus,
.wb-modal select:focus {
    border-color: rgba(99,102,241,0.45);
}

/* ═══════════════════════════════════════════════════════════════════
   Command builder — "Eigene Kennzahl definieren" (.wb-cmd-* family)
   IDE / command-palette input: monospace field + inline ghost-completion
   + grouped suggestion dropdown (INLINE, not floating — the rail has
   overflow:auto so an absolute dropdown would clip). Extends the .wb-*
   modal system; replaces the old inline styles in command.rs.
   ═══════════════════════════════════════════════════════════════════ */

.wb-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary, #f1f5f9); }

.wb-cmd { display: flex; flex-direction: column; gap: 8px; }

/* Framed monospace field (anchor for ghost mirror). */
.wb-cmd-box {
    position: relative;
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-input, rgba(12,18,34,0.5));
    border: 1px solid var(--glass-border, rgba(148,163,184,0.12));
    transition: border-color 150ms cubic-bezier(0.4,0,0.2,1),
                box-shadow 150ms cubic-bezier(0.4,0,0.2,1);
}
.wb-cmd-box:focus-within {
    border-color: var(--glass-border-hover, rgba(99,102,241,0.35));
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(99,102,241,0.12));
}
.wb-cmd-box.is-error:focus-within {
    border-color: rgba(251,191,36,0.45);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.12);
}

/* Ghost mirror + textarea MUST share identical box metrics or the ghost drifts. */
.wb-cmd-ghost,
.wb-cmd-input {
    margin: 0;
    padding: 11px 13px;
    font-family: var(--font-mono, 'JetBrains Mono','Fira Code',ui-monospace,Menlo,monospace);
    font-size: 13px;
    line-height: 1.55;
    letter-spacing: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 2;
}
.wb-cmd-ghost { position: absolute; inset: 0; pointer-events: none; overflow: hidden; user-select: none; }
.wb-cmd-ghost .typed { color: transparent; }
.wb-cmd-ghost .completion { color: rgba(226,232,240,0.5); font-style: italic; }
.wb-cmd-input {
    position: relative; display: block;
    width: 100%; box-sizing: border-box; min-height: 72px;
    background: transparent; border: 0; outline: 0;
    color: var(--text-primary, #f1f5f9);
    caret-color: var(--accent-hover, #818cf8);
    resize: none;
}
.wb-cmd-input::placeholder { color: var(--text-muted, #64748b); }

/* Inline grouped suggestion list (glass panel below the field). */
.wb-cmd-drop {
    margin-top: 6px;
    max-height: min(46vh, 340px);
    overflow-y: auto;
    padding: 5px;
    background: var(--glass-bg-solid, rgba(12,18,34,0.97));
    border: 1px solid var(--glass-border, rgba(148,163,184,0.12));
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,0.55));
    animation: wb-cmd-pop 140ms cubic-bezier(0.2,0.9,0.3,1.2);
    scrollbar-width: thin;
}
@keyframes wb-cmd-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.wb-cmd-drop::-webkit-scrollbar { width: 7px; }
.wb-cmd-drop::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.18); border-radius: 4px; }

.wb-cmd-group {
    position: sticky; top: 0; z-index: 1;
    padding: 7px 10px 3px;
    font-size: 0.64rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    background: #0c1222;
}

.wb-cmd-opt {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 7px 10px; border-radius: 8px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-secondary, #94a3b8); cursor: pointer;
    transition: background 150ms cubic-bezier(0.4,0,0.2,1), border-color 150ms cubic-bezier(0.4,0,0.2,1);
}
.wb-cmd-opt:hover { background: var(--accent-soft, rgba(99,102,241,0.12)); }
.wb-cmd-opt.active {
    background: rgba(99,102,241,0.16);
    border-color: rgba(99,102,241,0.4);
    color: var(--text-primary, #f1f5f9);
}
.wb-cmd-opt-icon {
    flex-shrink: 0; width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 0.7rem; font-weight: 700;
    background: rgba(255,255,255,0.05); color: var(--text-accent, #a5b4fc);
}
.wb-cmd-opt-icon.cat-display { background: rgba(99,102,241,0.16); color: #c7d2fe; }
.wb-cmd-opt-icon.cat-measure { background: rgba(52,211,153,0.14); color: #6ee7b7; }
.wb-cmd-opt-icon.cat-dim     { background: rgba(96,165,250,0.14); color: #93c5fd; }
.wb-cmd-opt-icon.cat-filter  { background: rgba(251,191,36,0.14); color: #fcd34d; }
.wb-cmd-opt-icon.cat-time    { background: rgba(45,212,191,0.14); color: #5eead4; }
.wb-cmd-opt-icon.cat-people  { background: rgba(167,139,250,0.16); color: #c4b5fd; }
.wb-cmd-opt-icon.cat-value   { background: rgba(148,163,184,0.14); color: #cbd5e1; }
.wb-cmd-opt-token { font-family: var(--font-mono, ui-monospace,Menlo,monospace); font-size: 0.8rem; font-weight: 600; color: inherit; white-space: nowrap; }
.wb-cmd-opt-gloss { flex: 1; min-width: 0; font-size: 0.75rem; color: var(--text-muted, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-cmd-opt-key {
    flex-shrink: 0; font-size: 0.62rem; font-weight: 700;
    padding: 1px 6px; border-radius: 5px;
    background: rgba(255,255,255,0.06); color: var(--text-secondary, #94a3b8);
    opacity: 0; transition: opacity 150ms;
}
.wb-cmd-opt.active .wb-cmd-opt-key { opacity: 1; }

/* Keyboard legend. */
.wb-cmd-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.7rem; color: var(--text-muted, #64748b); }
.wb-cmd-keys kbd {
    font-family: var(--font-mono, ui-monospace,Menlo,monospace);
    font-size: 0.66rem; padding: 1px 5px; border-radius: 5px; margin-right: 2px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09);
    color: var(--text-secondary, #94a3b8);
}

/* Status line: neutral / valid / soft-error (NO red block mid-typing). */
.wb-cmd-status { min-height: 20px; font-size: 0.76rem; line-height: 1.35; transition: color 150ms; overflow-wrap: anywhere; word-break: break-word; }
/* Keep any preview empty/hint text inside its pane. */
.wb-preview-empty { overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.wb-cmd-status.neutral { color: var(--text-muted, #64748b); }
.wb-cmd-status.valid   { color: var(--success, #34d399); }
.wb-cmd-status.hint    { padding: 6px 10px; border-radius: 8px; color: #fcd34d; background: rgba(251,191,36,0.09); border: 1px solid rgba(251,191,36,0.22); }

/* Examples (collapsible, clickable monospace rows). */
.wb-cmd-examples { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.wb-cmd-examples > summary { list-style: none; cursor: pointer; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary, #94a3b8); padding: 2px 0; }
.wb-cmd-examples > summary::-webkit-details-marker { display: none; }
.wb-cmd-examples > summary::before { content: "▸ "; color: var(--text-muted, #64748b); }
.wb-cmd-examples[open] > summary::before { content: "▾ "; }
.wb-cmd-ex {
    width: 100%; text-align: left;
    font-family: var(--font-mono, ui-monospace,Menlo,monospace);
    font-size: 0.72rem; color: var(--text-muted, #64748b);
    padding: 6px 9px; border-radius: 7px;
    background: rgba(255,255,255,0.02); border: 1px solid transparent; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: background 150ms, color 150ms;
}
.wb-cmd-ex:hover { background: var(--accent-soft, rgba(99,102,241,0.12)); color: var(--text-accent, #a5b4fc); }

/* Preview loading shimmer (replaces bare "Wird berechnet…"). */
.wb-cmd-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted, #64748b); font-size: 0.8rem; }
.wb-cmd-loading::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(148,163,184,0.18); border-top-color: var(--accent, #6366f1); animation: wb-cmd-spin 0.7s linear infinite; }
@keyframes wb-cmd-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .wb-cmd-drop { animation: none; }
    .wb-cmd-loading::before { animation-duration: 1.6s; }
}

/* Non-blocking advisory tip (info-level, NOT an error). */
.wb-cmd-advisory {
    display: flex; align-items: flex-start; gap: 7px; margin-top: 4px;
    padding: 6px 10px; border-radius: 8px; font-size: 0.76rem; line-height: 1.4;
    color: #93c5fd; background: rgba(96,165,250,0.08); border: 1px solid rgba(96,165,250,0.22);
}
.wb-cmd-advisory-ico { flex-shrink: 0; }

/* Live-preview chart skeleton — a faint chart-shape that "fills in". */
.wb-cmd-skel {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; animation: wb-skel-pulse 1.6s ease-in-out infinite;
}
.wb-skel-svg { width: 62%; max-width: 220px; height: auto; color: rgba(148,163,184,0.35); }
.wb-skel-num { font-size: 3rem; font-weight: 700; color: rgba(148,163,184,0.3); }
.wb-cmd-skel-label { font-size: 0.78rem; color: var(--text-muted, #64748b); }
@keyframes wb-skel-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wb-cmd-skel { animation: none; } }

/* ── Dashboard-Apps: fixed-function mini-widgets (widget/apps.rs) ───────────── */

.wapp {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Full width: the widget body is a centering flex-row (for charts) — without
       this the app card would sit content-width + centered, so the left stripe
       wouldn't reach the edge and the right-aligned items wouldn't reach the far
       side. */
    width: 100%;
    min-width: 0;
    gap: 8px;
    box-sizing: border-box;
}
/* App widgets own the whole box — kill the chrome body gutters so the accent
   stripe sits flush on the left edge, then re-add spacing on the card itself. */
.dash-widget-app .dash-widget-body {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}
.wapp-appt {
    padding: 11px 12px 12px;
    border-left: 3px solid var(--wapp-accent, #818cf8);
}
.wapp-head {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
    /* Fixed height: the 26px action circles must not grow the header (no shift
       of the body when they appear). */
    min-height: 26px;
}
.wapp-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wapp-head-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
}
/* ••• ↔ ✗ toggle */
.wapp-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.wapp-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}
.wapp-menu-toggle svg {
    width: 15px;
    height: 15px;
}
/* Triage action circles */
.wapp-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, background 0.12s, border-color 0.12s;
}
.wapp-act:hover {
    transform: translateY(-1px);
}
.wapp-act svg {
    width: 16px;
    height: 16px;
}
.wapp-act-done {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.3);
}
.wapp-act-done:hover {
    background: rgba(52, 211, 153, 0.22);
}
.wapp-act-noshow {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
}
.wapp-act-noshow:hover {
    background: rgba(251, 191, 36, 0.22);
}
.wapp-act-cancel {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.3);
}
.wapp-act-cancel:hover {
    background: rgba(248, 113, 113, 0.22);
}
.wapp-ico {
    line-height: 0;
    color: #818cf8;
}
.wapp-ico svg {
    width: 15px;
    height: 15px;
}
.wapp-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* "Nächster Termin" body — a left accent stripe in the Terminart colour. */
.wapp-appt-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.wapp-when-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.wapp-when {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.wapp-countdown {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--wapp-accent, #818cf8);
    background: color-mix(in srgb, var(--wapp-accent, #818cf8) 16%, transparent);
    padding: 1px 6px;
    border-radius: 7px;
    white-space: nowrap;
}
.wapp-who-row {
    display: flex;
    align-items: center;
    gap: 7px;
}
.wapp-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--wapp-accent, #818cf8);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.wapp-following {
    margin-top: 2px;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.34);
}
.wapp-who {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.82);
}
.wapp-who-link {
    color: #a5b4fc;
    text-decoration: none;
    cursor: pointer;
}
.wapp-who-link:hover {
    text-decoration: underline;
}
.wapp-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}
.wapp-tag {
    align-self: flex-start;
    margin-top: 3px;
    font-size: 0.66rem;
    color: var(--wapp-accent, #c7d2fe);
    background: color-mix(in srgb, var(--wapp-accent, #6366f1) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--wapp-accent, #6366f1) 38%, transparent);
    padding: 2px 7px;
    border-radius: 6px;
}

/* Loading / empty / error state */
.wapp-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
}
.wapp-unknown {
    padding: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Tenant management */

/* ═══════════════════════════════════════════════════════════════════════════
   TENANT MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* Create form grid — 3 columns */
.tenant-create-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Subdomain input with .selly.tech suffix */
.tenant-subdomain-input {
    display: flex;
    align-items: center;
    gap: 0;
}
.tenant-subdomain-input .admin-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1;
}
.tenant-subdomain-suffix {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-left: none;
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    height: 38px;
    display: flex;
    align-items: center;
}

/* Tenant name cell with master badge */
.tenant-name-cell {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Subdomain code display */
.tenant-subdomain-code {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

/* Lead count progress bar */
.tenant-lead-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}
.tenant-lead-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.tenant-lead-track {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}
.tenant-lead-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.tenant-lead-ok { background: var(--status-green, #22c55e); }
.tenant-lead-warn { background: var(--status-amber, #f59e0b); }
.tenant-lead-danger { background: var(--status-red, #ef4444); }

/* Stats overlay */
.tenant-stats-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
.tenant-stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 420px;
    max-width: 520px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}
.tenant-stats-card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}
.tenant-stats-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.tenant-stats-close:hover { color: var(--text-primary); }
.tenant-stats-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    margin-bottom: var(--space-md);
}
.tenant-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}
.tenant-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.tenant-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
}
.tenant-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Alert success */
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* Text center utility */
.text-center { text-align: center; }


/* ══════════════════════════════════════════════════════════════════════
   Pipeline Canvas — Sell.ly navy glass
   Surfaces from the token palette (deep navy + indigo accents); the old
   board.svg draft colors (#001120 teal / #434d7b slate) are retired.
   ══════════════════════════════════════════════════════════════════════ */

/* (Removed legacy `.app-main:has(.pc-editor)` full-page override — the pipeline
   editor is now hosted inside the admin window panel, which handles fill/padding.) */

/* ── Editor Layout — transparent: the admin window provides the surface ── */
.pc-editor {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    background: transparent;
    outline: none;
    position: relative;
}

/* ── Inline Icon helpers ── */
.icon-inline {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    width: 18px; height: 18px;
}
.icon-inline svg { width: 18px; height: 18px; }
.icon-sm {
    display: inline-flex;
    align-items: center;
    width: 14px; height: 14px;
}
.icon-sm svg { width: 14px; height: 14px; }

/* ── Toolbar: transparent, no background (board.svg) ── */
.pc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: transparent;
    border: none;
    z-index: 20;
    gap: 12px;
}
.pc-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.pc-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.pc-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #94A3B8);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.pc-back-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.pc-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.pc-undo-group {
    display: flex;
    gap: 2px;
}
.pc-undo-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pc-undo-btn:hover { background: rgba(255,255,255,0.12); }
.pc-btn-disabled { opacity: 0.3; pointer-events: none; }

.pc-tb-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #94A3B8);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.pc-tb-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.pc-tb-red { color: var(--danger); }
.pc-tb-red:hover { background: rgba(248,113,113,0.15); color: var(--danger); }

/* Speichern is THE primary CTA on this page — solid accent fill + glow on
   hover, like every other primary button in the app. */
.pc-save-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.pc-save-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}
.pc-save-btn svg { width: 16px; height: 16px; }

/* ── Floating Popup Inner ── */
.prop-body {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 50vh; overflow-y: auto;
}
.prop-body::-webkit-scrollbar { width: 4px; }
.prop-body::-webkit-scrollbar-track { background: transparent; }
.prop-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.pc-props-inner {
    display: flex; flex-direction: column; gap: 0;
}

.pc-save-feedback {
    color: var(--success);
    font-size: 12px;
    font-weight: 500;
    animation: pc-fade-in 0.3s ease;
}

.pc-zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pc-zoom-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #94A3B8);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    min-width: 48px;
    text-align: center;
    transition: all 0.2s;
}
.pc-zoom-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
/* Square ± zoom steppers flanking the %-reset */
.pc-zoom-sq { min-width: 28px; padding: 4px 8px; font-size: 13px; }

/* ── Reset confirmation modal body ── */
.pc-reset-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 16px;
}
.pc-reset-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.pc-grid-toggle { display: flex; gap: 2px; }
.pc-grid-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted, #64748B);
    width: 28px; height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.pc-grid-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.pc-grid-btn.active { background: var(--accent-glow); color: var(--accent-hover); border-color: var(--glass-border-hover); }

/* ── Workspace: board.svg — gap between panels ── */
.pc-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    gap: 12px;
    padding: 0 12px 12px;
    background: transparent;
}

/* ── SVG Canvas: navy glass frame + sunken near-black-blue interior ── */
.pc-canvas-wrap {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 14px;
    position: relative;
    min-width: 0;
}
.pc-canvas {
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 20, 0.75);
    border-radius: 12px;
    cursor: grab;
}
.pc-canvas:active { cursor: grabbing; }

/* ── ForeignObject icon in SVG ── */
.pc-fo-icon {
    overflow: visible;
    pointer-events: none;
}
.pc-fo-icon svg {
    width: 20px;
    height: 20px;
}
.pc-fo-icon--sm svg {
    width: 12px;
    height: 12px;
}


/* ── Edges ── */
.pc-edge {
    stroke: rgba(99,102,241,0.5);
    stroke-width: 2;
    fill: none;
    transition: stroke 0.2s, stroke-width 0.2s;
}
.pc-edge:hover { stroke: var(--accent-hover); stroke-width: 3; }
.pc-edge-label {
    font-size: 11px;
    fill: rgba(255,255,255,0.5);
}

/* ═══════════════════════════════════════════════════════
   #2: NEON GLOW NODES
   ═══════════════════════════════════════════════════════ */

.pc-node-group {
    cursor: pointer;
    /* NO CSS transform — it overrides SVG transform attribute! */
}
.pc-node-group:hover .pc-node-body {
    filter: brightness(1.2) drop-shadow(0 0 8px currentColor);
}
.pc-node-body {
    stroke-width: 1.5;
    transition: all 0.25s ease;
    will-change: filter;
}
/* Selected = pulsing neon glow */
.pc-node-selected {
    stroke-width: 2 !important;
    animation: pc-glow-pulse 2s ease-in-out infinite;
}

@keyframes pc-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(99,102,241,0.4)); }
    50%      { filter: drop-shadow(0 0 16px rgba(99,102,241,0.7)) drop-shadow(0 0 32px rgba(99,102,241,0.2)); }
}

.pc-node-icon {
    fill: #fff;
    font-size: 18px;
    dominant-baseline: middle;
}
.pc-node-label {
    fill: #fff;
    font-size: 14px;
    font-weight: 600;
    dominant-baseline: middle;
}
.pc-node-label-sm {
    fill: #fff;
    font-size: 11px;
    font-weight: 500;
}
.pc-node-sub {
    fill: rgba(255,255,255,0.5);
    font-size: 11px;
    dominant-baseline: middle;
}
.pc-node-badge {
    fill: #fff;
    font-size: 10px;
    font-weight: 600;
}

/* ── Ports ── */
.pc-port {
    fill: rgba(15,18,35,0.9);
    stroke: var(--accent);
    stroke-width: 2;
    cursor: crosshair;
    transition: all 0.2s;
    r: 7;
}
.pc-port:hover {
    fill: var(--accent);
    r: 9;
    filter: drop-shadow(0 0 6px rgba(99,102,241,0.6));
}
.pc-port-label {
    font-size: 10px;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════
   #3: GLASSMORPHISM PANELS
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar: Glassmorphic floating panel (board.svg) ── */
.pc-palette {
    width: 260px;
    min-width: 260px;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pc-palette::-webkit-scrollbar { display: none; }
.pc-palette-header {
    padding: 0 20px 2px;
}
.pc-palette-header h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}
.pc-palette-hint {
    font-size: 0.72rem; color: var(--text-muted);
    display: block;
    margin: 0; padding: 0 20px 12px;
}
.pc-palette-category {
    padding: 0;
}
.pc-palette-cat-header {
    padding: 14px 20px 6px;
}
.pc-palette-cat-name {
    font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
    letter-spacing: 0.12em; text-transform: uppercase;
}
.pc-palette-cat-desc {
    display: none;
}
.pc-palette-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}
.pc-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--glass-border-subtle);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: grab;
    transition: all 0.2s;
    font-size: 0.84rem;
    text-align: left;
}
.pc-palette-item:active { cursor: grabbing; }
.pc-palette-item:hover {
    background: var(--accent-soft);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}
.pc-palette-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.pc-palette-icon svg {
    width: 18px;
    height: 18px;
}
.pc-palette-item:hover .pc-palette-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px currentColor);
}
.pc-palette-name {
    font-weight: 500;
}

/* ── Properties Panel (Glassmorphism) ── */
.pc-props {
    width: 280px;
    min-width: 280px;
    background: rgba(15, 18, 35, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    padding: 0;
    animation: pc-slide-in 0.2s ease;
}
@supports not (backdrop-filter: blur(1px)) {
    .pc-props { background: rgba(15, 18, 35, 0.95); }
}
.pc-props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pc-props-header h4 {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}
.pc-props-close {
    background: none;
    border: none;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.pc-props-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.pc-props-field {
    padding: 10px 16px;
}
.pc-props-field label {
    display: block;
    color: var(--text-secondary, #94A3B8);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.pc-props-field input[type="color"] {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    cursor: pointer;
}
.pc-props-field input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}
.pc-props-hint {
    color: var(--text-muted, #64748B);
    font-size: 11px;
    padding: 4px 16px 12px;
    margin: 0;
}
.pc-props-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.pc-props-check input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* ── Minimap ── */
.pc-minimap {
    position: absolute;
    bottom: 40px;
    right: 16px;
    width: 200px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
    pointer-events: none;
}
.pc-minimap:hover { opacity: 1; pointer-events: auto; }
.pc-minimap-svg {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}
/* Minimap panel fill — elevated navy so it reads as a panel on the board. */
.pc-minimap-bg { fill: var(--bg-elevated); }

/* ── Status Bar ── */
.pc-statusbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    background: rgba(15,18,35,0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted, #64748B);
    font-size: 11px;
    z-index: 20;
}


/* ═══════════════════════════════════════════════════════
   #4: NODE POP-IN ANIMATION
   ═══════════════════════════════════════════════════════ */

/* Node pop-in animation REMOVED — it replays on every Leptos re-render,
   making nodes invisible during drag (opacity restarts at 0 each frame).
   If a pop-in effect is needed, apply it via a one-shot JS class instead. */

/* Edge draw-in animation */
.pc-edge {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: pc-edge-draw 0.6s ease forwards;
}

@keyframes pc-edge-draw {
    to { stroke-dashoffset: 0; }
}

/* ═══════════════════════════════════════════════════════
   #11: ANIMATED BACKGROUND GRID (parallax dual-layer)
   ═══════════════════════════════════════════════════════ */

/* Grid dots — kept simple, inner black area already provided by .pc-canvas */

/* ── List Page ── */
.pc-list-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}
.pc-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
}
.pc-list-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}
.pc-list-sub {
    color: var(--text-secondary, #94A3B8);
    font-size: 14px;
    margin: 4px 0 0;
}
.pc-list-actions {
    display: flex;
    gap: 8px;
}
.pc-create-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}
.pc-create-form .cf-input {
    flex: 1;
}

/* ── Pipeline Cards Grid ── */
.pc-pipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.pc-pipe-card {
    background: rgba(15,18,35,0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.pc-pipe-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366F1, #818CF8, #6366F1);
    opacity: 0;
    transition: opacity 0.3s;
}
.pc-pipe-card:hover {
    border-color: rgba(99,102,241,0.3);
    background: rgba(20,24,50,0.6);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(99,102,241,0.1);
}
.pc-pipe-card:hover::before { opacity: 1; }
.pc-pipe-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pc-pipe-card-header h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.pc-pipe-card-icon {
    font-size: 22px;
}
.pc-pipe-card-desc {
    color: var(--text-muted, #64748B);
    font-size: 12px;
    margin: 0 0 16px;
}
.pc-pipe-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pc-pipe-card-open {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.25);
    color: #818CF8;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pc-pipe-card-open:hover {
    background: rgba(99,102,241,0.25);
    box-shadow: 0 0 12px rgba(99,102,241,0.2);
}
.pc-pipe-card-del {
    background: none;
    border: none;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.pc-pipe-card-del:hover {
    color: #EF4444;
    background: rgba(239,68,68,0.1);
}

/* ── Empty State ── */
.pc-empty {
    text-align: center;
    padding: 80px 24px;
}
.pc-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}
.pc-empty h3 {
    color: #fff;
    font-size: 18px;
    margin: 0 0 8px;
}
.pc-empty p {
    color: var(--text-secondary, #94A3B8);
    font-size: 14px;
    margin: 0 0 24px;
}

/* Inline rename input in the pipeline card header */
.pc-pipe-rename {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    padding: 4px 8px;
}


/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes pc-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pc-slide-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════
   FLOWING EDGE PARTICLES (#1 — enabled via SVG animateMotion)
   ═══════════════════════════════════════════════════════ */
.pc-particle {
    opacity: 0.8;
    filter: blur(0.5px);
}

/* ═══════════════════════════════════════════════════════
   STAGE HEATMAP (#5 — CSS custom property driven)
   ═══════════════════════════════════════════════════════ */
.pc-node-heat-low    { filter: none; }
.pc-node-heat-medium { filter: drop-shadow(0 0 6px rgba(234,179,8,0.3)); }
.pc-node-heat-high   { filter: drop-shadow(0 0 8px rgba(249,115,22,0.4)); }
.pc-node-heat-hot    { filter: drop-shadow(0 0 12px rgba(239,68,68,0.5)); }

/* ═══════════════════════════════════════════════════════
   #6: CONTEXT MENU (Glassmorphism)
   ═══════════════════════════════════════════════════════ */
.pc-ctx-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
}
.pc-ctx-menu {
    position: fixed;
    min-width: 180px;
    background: rgba(15, 18, 35, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1);
    animation: pc-ctx-pop 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    z-index: 101;
}
@keyframes pc-ctx-pop {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.pc-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text-secondary, #94A3B8);
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.pc-ctx-item:hover {
    background: rgba(99,102,241,0.15);
    color: #fff;
}
.pc-ctx-danger:hover {
    background: rgba(239,68,68,0.15);
    color: #F87171;
}
.pc-ctx-icon {
    width: 16px; height: 16px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.pc-ctx-icon svg { width: 16px; height: 16px; }
.pc-ctx-label { flex: 1; }

/* ═══════════════════════════════════════════════════════
   #7: SNAP ALIGNMENT GUIDES
   ═══════════════════════════════════════════════════════ */
.pc-guide-line {
    stroke: rgba(99,102,241,0.4);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
    animation: pc-guide-fade 0.15s ease;
}
@keyframes pc-guide-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════
   #12: KEYBOARD SHORTCUT OVERLAY
   ═══════════════════════════════════════════════════════ */
.pc-shortcut-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pc-fade-in 0.2s ease;
}
.pc-shortcut-modal {
    background: rgba(15, 18, 35, 0.9);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 380px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.6);
    animation: pc-ctx-pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.pc-shortcut-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pc-shortcut-header h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.pc-shortcut-close {
    background: none;
    border: none;
    color: var(--text-muted, #64748B);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.pc-shortcut-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.pc-shortcut-body { padding: 8px 20px 16px; }
.pc-shortcut-group { margin-bottom: 16px; }
.pc-shortcut-group-name {
    color: var(--text-secondary, #94A3B8);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}
.pc-shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}
.pc-shortcut-desc {
    color: var(--text-secondary, #94A3B8);
    font-size: 12px;
}
.pc-shortcut-key {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #818CF8;
    background: rgba(99,102,241,0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(99,102,241,0.15);
}

/* ═══════════════════════════════════════════════════════
   #14: EMPTY CANVAS WELCOME STATE
   ═══════════════════════════════════════════════════════ */
.pc-empty-canvas {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}
.pc-empty-canvas-inner {
    text-align: center;
    pointer-events: auto;
    animation: pc-fade-in 0.5s ease;
}
/* While a palette block is dragged, let drops pass through to the canvas. */
.pc-workspace.pc-palette-dragging .pc-empty-canvas-inner {
    pointer-events: none;
}
.pc-empty-illustration {
    margin-bottom: 20px;
    opacity: 0.8;
}
.pc-empty-canvas-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}
.pc-empty-canvas-desc {
    color: var(--text-secondary, #94A3B8);
    font-size: 13px;
    margin: 0 0 20px;
}
.pc-empty-arrow {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    animation: pc-empty-nudge 1.5s ease-in-out infinite;
}
@keyframes pc-empty-nudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-8px); }
}
.pc-empty-arrow-label {
    color: rgba(99,102,241,0.6);
    font-size: 11px;
    font-weight: 600;
}
.pc-quick-start-btn {
    background: linear-gradient(135deg, #6366F1, #818CF8);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.pc-quick-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99,102,241,0.5);
}

/* ═══════════════════════════════════════════════════════
   #15: PREMIUM TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */
.pc-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 360px;
}
.pc-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(15, 18, 35, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: pc-toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    position: relative;
    overflow: hidden;
}
@keyframes pc-toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}
.pc-toast-icon {
    width: 18px; height: 18px;
    display: flex; align-items: center;
    flex-shrink: 0;
}
.pc-toast-icon svg { width: 18px; height: 18px; }
.pc-toast-msg {
    flex: 1;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}
.pc-toast-close {
    background: none;
    border: none;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: color 0.2s;
}
.pc-toast-close:hover { color: #fff; }
.pc-toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    animation: pc-toast-timer 4.2s linear forwards;
}
@keyframes pc-toast-timer {
    from { width: 100%; }
    to   { width: 0%; }
}
/* Toast type colors */
.pc-toast-success { border-left: 3px solid #22C55E; }
.pc-toast-success .pc-toast-icon { color: #22C55E; }
.pc-toast-success .pc-toast-progress { background: #22C55E; }

.pc-toast-error { border-left: 3px solid #EF4444; }
.pc-toast-error .pc-toast-icon { color: #EF4444; }
.pc-toast-error .pc-toast-progress { background: #EF4444; }

.pc-toast-info { border-left: 3px solid #6366F1; }
.pc-toast-info .pc-toast-icon { color: #6366F1; }
.pc-toast-info .pc-toast-progress { background: #6366F1; }

.pc-toast-warning { border-left: 3px solid #EAB308; }
.pc-toast-warning .pc-toast-icon { color: #EAB308; }
.pc-toast-warning .pc-toast-progress { background: #EAB308; }

/* #9: CONVERSION RATE BADGE on Edges */
.pc-conv-badge {
    font-size: 10px;
    font-weight: 700;
    dominant-baseline: middle;
    text-anchor: middle;
}
.pc-conv-bg {
    rx: 10;
    ry: 10;
    opacity: 0.9;
}

/* ── Automation run history (Verlauf modal) ── */
.pc-exec-list { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.pc-exec-empty { color: var(--text-muted); font-size: 0.85rem; padding: 16px 4px; margin: 0; }
.pc-exec-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 4px; border-bottom: 1px solid var(--glass-border-subtle);
}
.pc-exec-row:last-child { border-bottom: none; }
.pc-exec-status {
    flex: 0 0 auto; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 8px; margin-top: 2px;
    background: rgba(248, 113, 113, 0.15); color: var(--danger);
}
.pc-exec-status.ok { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.pc-exec-status.wait { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.pc-exec-status.skip { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.pc-exec-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pc-exec-title { color: var(--text-primary); font-size: 0.82rem; font-weight: 600; }
.pc-exec-sub { color: var(--text-secondary); font-size: 0.76rem; }
.pc-exec-time { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; margin-top: 3px; }

/* ── Chain-editor edges & universal ports (override the generic .pc-edge
      draw-in from _04, whose stroke-dasharray would eat the dash pattern) ── */
.pc-edge-jump {
    stroke: rgba(244, 114, 182, 0.65);
    stroke-dasharray: 7 5;
    animation: none;
}
.pc-edge-jump:hover { stroke: #F472B6; }
.pc-edge-preview {
    stroke: var(--accent);
    stroke-dasharray: 6 4;
    animation: none;
}

/* Universal ports: hidden until the block is hovered — four subtle docking
   points instead of a fixed in/out pair. Decision Ja/Nein exits stay visible
   (their labels are, too). */
.pc-node-group .pc-port { opacity: 0; }
.pc-node-group:hover .pc-port,
.pc-node-group .pc-port:hover { opacity: 1; }
.pc-node-group .pc-port-out { opacity: 1; }

/* Off-chain stage→stage line: no trigger, no meaning — shout it. */
.pc-edge-invalid {
    stroke: rgba(239, 68, 68, 0.8);
    stroke-dasharray: 3 5;
    animation: none;
}
.pc-edge-invalid:hover { stroke: #EF4444; }

/* ═══════════════════════════════════════════════════════════════
   Teams & Hierarchie — Premium Admin Styles
   ═══════════════════════════════════════════════════════════════ */

.teams-page {
  padding: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Toast ──────────────────────────────────────────────────── */
.teams-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: linear-gradient(135deg, rgba(34,197,94,0.95), rgba(16,185,129,0.95));
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: teamsToastIn 0.3s ease;
}
@keyframes teamsToastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ────────────────────────────────────────────────── */
.teams-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.teams-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.teams-header-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 12px;
  color: #fff;
}
.teams-header-icon svg {
  width: 22px;
  height: 22px;
}
.teams-title {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}
.teams-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin: 2px 0 0 0;
}
.teams-create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.teams-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.teams-create-btn svg { width: 16px; height: 16px; }

/* ── Create Form ───────────────────────────────────────────── */
.teams-create-form {
  margin: 0 28px;
  padding: 24px;
  background: rgba(30,30,50,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  animation: teamsFormIn 0.25s ease;
}

/* ── Overlays (click outside closes) ───────────────────────── */
.teams-modal-wrap {
  width: min(560px, 92vw);
}
.teams-modal-wrap .teams-create-form {
  margin: 0;
}
.teams-detail-modal {
  width: min(760px, 94vw);
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes teamsFormIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.teams-create-form h3 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 16px 0;
}
.teams-form-grid {
  display: grid;
  /* Single column — inside the (narrow) DragModal a 2-col grid overflowed and
     forced sideways scrolling. Fields stack full-width instead. */
  grid-template-columns: 1fr;
  gap: 12px;
}
.teams-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.teams-form-field label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.teams-input, .teams-select {
  padding: 10px 14px;
  background: rgba(15,15,30,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.teams-input:focus, .teams-select:focus {
  border-color: #6366f1;
}
.teams-select option {
  background: #1e1e3a;
  color: #e2e8f0;
}
.teams-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.teams-color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.teams-color-dot:hover { transform: scale(1.15); }
.teams-color-active { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.3); }
.teams-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.teams-btn-cancel {
  padding: 9px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.teams-btn-cancel:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.teams-btn-save {
  padding: 9px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.teams-btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

/* ── Loading ───────────────────────────────────────────────── */
.teams-loading {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
}


/* ── Content: Tree + Detail ────────────────────────────────── */
.teams-content {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}

/* ── Tree Panel ────────────────────────────────────────────── */
.teams-tree {
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  padding: 16px 0;
}
.teams-tree-list {
  display: flex;
  flex-direction: column;
}
.teams-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: rgba(255,255,255,0.35);
}
.teams-empty-icon svg { width: 48px; height: 48px; opacity: 0.3; }
.teams-tree-item { display: flex; flex-direction: column; }
.teams-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}
.teams-tree-row:hover {
  background: rgba(99,102,241,0.08);
}
.teams-tree-selected {
  background: rgba(99,102,241,0.15) !important;
  color: #a5b4fc;
}
.teams-tree-arrow {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  width: 16px;
  text-align: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.teams-tree-arrow-open { transform: rotate(90deg); }
.teams-tree-arrow-spacer { width: 16px; flex-shrink: 0; }
.teams-tree-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.teams-tree-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teams-tree-count {
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.teams-tree-leader {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: rgba(234,179,8,0.7);
  flex-shrink: 0;
}
.teams-tree-leader svg { width: 11px; height: 11px; }
.teams-tree-children { /* rendered inline */ }

/* ── Detail Panel ──────────────────────────────────────────── */
.teams-detail {
  overflow-y: auto;
  padding: 24px;
}
.teams-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: rgba(255,255,255,0.25);
}
.teams-detail-empty svg { width: 48px; height: 48px; opacity: 0.2; }
.teams-detail-card {
  background: rgba(25,25,45,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  animation: teamsDetailIn 0.2s ease;
}
@keyframes teamsDetailIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.teams-detail-header {
  padding: 20px 24px;
  background: rgba(99,102,241,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.teams-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.teams-detail-title-row h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}
.teams-inline-edit {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 6px;
  outline: none;
  flex: 1;
  min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}
.teams-inline-edit:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
}
.teams-inline-edit:focus {
  border-color: #6366f1;
  background: rgba(99,102,241,0.08);
}
.teams-delete-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: #ef4444;
  transition: all 0.2s;
}
.teams-delete-btn:hover { background: rgba(239,68,68,0.2); }
.teams-delete-btn svg { width: 16px; height: 16px; }
.teams-detail-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin: 6px 0 0 0;
}
.teams-detail-meta {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.teams-meta-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  color: rgba(255,255,255,0.55);
}
.teams-meta-badge svg { width: 12px; height: 12px; }
.teams-meta-leader { color: #eab308; background: rgba(234,179,8,0.1); }


/* ── Members Section ───────────────────────────────────────── */
.teams-members-section {
  padding: 20px 24px;
}
.teams-members-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 14px 0;
}
.teams-members-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.teams-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s;
}
.teams-member-row:hover { background: rgba(255,255,255,0.03); }
.teams-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.teams-member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.teams-member-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teams-member-email {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.teams-role-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
}
.teams-role-leader { background: rgba(234,179,8,0.15); color: #eab308; }
.teams-role-member { background: rgba(99,102,241,0.12); color: #a5b4fc; }
.teams-role-guest  { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
.teams-member-action {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  transition: all 0.15s;
  flex-shrink: 0;
}
.teams-member-action:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.teams-member-action svg { width: 14px; height: 14px; }
.teams-member-remove:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ── Add Member Row ────────────────────────────────────────── */
.teams-add-member {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.teams-add-select { flex: 1; }
.teams-role-select { width: 120px; }
.teams-btn-add {
  padding: 8px 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.teams-btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,0.3); }

/* ── Hierarchy Path Card ───────────────────────────────────── */
.teams-hierarchy-card {
  margin-top: 20px;
  padding: 20px 24px;
  background: rgba(25,25,45,0.5);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  animation: teamsDetailIn 0.25s ease;
}
.teams-hierarchy-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 16px 0;
}
.teams-hierarchy-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(99,102,241,0.08);
  border-radius: 10px;
}
.teams-hierarchy-user svg { width: 18px; height: 18px; }
.teams-hierarchy-path {
  padding-left: 8px;
  margin-bottom: 12px;
}
.teams-hierarchy-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.teams-hierarchy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.teams-hierarchy-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.teams-hierarchy-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}
.teams-hierarchy-leader {
  font-size: 12px;
  color: rgba(234,179,8,0.6);
}
.teams-hierarchy-line {
  width: 2px;
  height: 16px;
  background: rgba(99,102,241,0.2);
  margin-left: 5px;
}
.teams-hierarchy-step:last-child + .teams-hierarchy-line {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   SalesKnowledge Reader — Card Grid + Popup (board.svg Design)
   ══════════════════════════════════════════════════════════════════ */

/* ── Search Bar ── */
.sk-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.sk-search-icon {
    position: absolute;
    left: 12px;
    pointer-events: none;
    color: rgba(255,255,255,0.3);
}
.sk-search-icon svg { width: 16px; height: 16px; }
.sk-search-field {
    padding-left: 36px !important;
    min-width: 220px;
}

/* ── Filter bar ── */
.sk-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}
.filter-btn {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.filter-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}
.filter-active {
    background: rgba(99,102,241,0.15) !important;
    border-color: rgba(99,102,241,0.35) !important;
    color: #a5b4fc !important;
    font-weight: 600;
}

/* Category pills */
.sk-cat-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.08);
}
.sk-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.72rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: all 0.15s;
}
.sk-pill:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
}
.sk-pill-active {
    background: rgba(99,102,241,0.1) !important;
    border-color: rgba(99,102,241,0.25) !important;
    color: #a5b4fc !important;
}
.sk-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Article Card Grid ── */
.sk-section { margin-top: var(--space-sm); }
.sk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Individual article card — glassmorphism */
.sk-article-card {
    background: rgba(15,18,35,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    color: #fff;
    font-family: inherit;
}
.sk-article-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366F1, #818CF8, #6366F1);
    opacity: 0;
    transition: opacity 0.3s;
}
.sk-article-card:hover {
    border-color: rgba(99,102,241,0.3);
    background: rgba(20,24,50,0.6);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(99,102,241,0.1);
}
.sk-article-card:hover::before { opacity: 1; }

/* Pinned card highlight */
.sk-card-pinned {
    border-color: rgba(99,102,241,0.2);
    background: rgba(99,102,241,0.06);
}
.sk-card-pinned::before { opacity: 0.5; }

.sk-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sk-meta-cat {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--c, #6366f1) 15%, transparent);
    color: var(--c, #6366f1);
    font-weight: 600;
}
.sk-badge-src {
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.8px;
}
.sk-src-selly {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
}
.sk-src-tenant {
    background: rgba(52,211,153,0.12);
    color: #34d399;
}

.sk-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}
.sk-card-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sk-card-foot {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: auto;
}
.sk-card-tag {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.35);
    border: 1px solid rgba(255,255,255,0.06);
}


/* ═══════════════════════════════════════════════════════════════
   POPUP — Draggable reader window (glassmorphism)
   ═══════════════════════════════════════════════════════════════ */

.skr-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 900;
    animation: skr-fade 0.15s ease;
}
@keyframes skr-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skr-popup {
    z-index: 901;
    background: rgba(15, 18, 40, 0.97);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.08),
        0 16px 60px rgba(0,0,0,0.6),
        0 0 80px rgba(99,102,241,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: skrPopIn 0.2s cubic-bezier(0.2, 0, 0.13, 1);
}
@keyframes skrPopIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Title bar */
.skr-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    background: rgba(99,102,241,0.04);
}
.skr-titlebar:active { cursor: grabbing; }
.skr-titlebar-left { display: flex; gap: 8px; align-items: center; }
.skr-titlebar-right { display: flex; gap: 4px; }

.skr-tb-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.skr-tb-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
}
.skr-close-btn:hover {
    color: #ff6464 !important;
    background: rgba(255,100,100,0.1) !important;
    border-color: rgba(255,100,100,0.3) !important;
}

/* Content area */
.skr-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    scrollbar-width: none;
}
.skr-content::-webkit-scrollbar { display: none; }

.skr-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 24px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* ── Block rendering in reader ── */
.sk-detail-body p {
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.65);
    margin: 6px 0;
}
.skr-h {
    color: #fff;
    font-weight: 600;
    margin: 24px 0 10px;
}
h1.skr-h { font-size: 1.3rem; }
h2.skr-h { font-size: 1.1rem; }
h3.skr-h { font-size: 0.95rem; }

.skr-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid rgba(245,158,11,0.5);
    border-radius: 0 10px 10px 0;
    margin: 14px 0;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    line-height: 1.6;
}
.skr-callout-icon { font-size: 1.1rem; flex-shrink: 0; }
blockquote.skr-callout {
    display: block;
    padding-left: 18px;
    font-style: italic;
}

.skr-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 20px 0;
}

.skr-list {
    padding-left: 22px;
    margin: 10px 0;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    line-height: 1.8;
}
.skr-list li { margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════════
   SalesKnowledge — FreeForm Canvas Editor (board.svg Design)
   Apple Freeform / Miro-style infinite canvas
   ══════════════════════════════════════════════════════════════════ */

/* (Removed legacy `.app-main:has(.skc-editor)` full-page override — the knowledge
   editor is now hosted inside the admin window panel, which handles fill/padding.) */

/* ── Full-screen editor container ── */
.skc-editor {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    background: #001120;
    outline: none;
}

/* ── Toolbar (floating glassmorphic bar) ── */
.skc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    margin: 8px 12px 0 12px;
    background: rgba(67, 77, 123, 0.42);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    gap: 12px;
    z-index: 50;
}
.skc-toolbar-left, .skc-toolbar-right { display: flex; align-items: center; gap: 10px; }

.flow-back-btn {
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.flow-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.skc-title-input {
    font-size: 1rem !important;
    font-weight: 700 !important;
    border: none !important;
    background: transparent !important;
    padding: 6px 8px !important;
    color: #fff !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 200px;
}
.skc-title-input::placeholder { color: rgba(255,255,255,0.2); font-weight: 400; }

.skc-pub-btn {
    font-size: 0.72rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.2s;
}
.skc-pub-on {
    background: rgba(20,163,6,0.15) !important;
    border-color: rgba(20,163,6,0.4) !important;
    color: #4ade80 !important;
}

/* ── Meta panel (slide-down) ── */
.skc-meta-panel {
    display: flex;
    gap: 16px;
    padding: 10px 24px;
    background: rgba(30,33,55,0.9);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    animation: skcMetaSlide 0.15s ease;
}
@keyframes skcMetaSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.skc-meta-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.skc-meta-field .form-label {
    font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.3);
    letter-spacing: 0.1em; text-transform: uppercase;
}
.skc-meta-field .input {
    font-size: 0.82rem; padding: 7px 12px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; color: #fff; outline: none;
}
.skc-meta-field .input:focus { border-color: rgba(99,102,241,0.5); }

/* ── Workspace: board.svg gap layout (like automation) ── */
.skc-workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    gap: 12px;
    padding: 8px 12px 12px 12px;
    background: transparent;
}

/* ═══════════════════════════════════════════════════════════
   PALETTE — Left sidebar (glassmorphic, like automation palette)
   ═══════════════════════════════════════════════════════════ */
.skc-palette {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(67, 77, 123, 0.52);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    border-right: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px 0;
    z-index: 10;
    scrollbar-width: none;
}

.skc-palette-header {
    padding: 0 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.skc-palette-header h4 {
    font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.8); margin: 0;
}

.skc-palette-hint {
    display: block;
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.2);
}

.skc-palette-items {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: none;
}
.skc-palette-items::-webkit-scrollbar { display: none; }

.skc-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.04);
    background: transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: #fff;
    width: 100%;
    font-family: inherit;
}
.skc-palette-item:hover {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.2);
    transform: translateX(3px);
}

.skc-palette-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.skc-pi-heading { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.skc-pi-text { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1); }
.skc-pi-callout { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); font-size: 1rem; }
.skc-pi-sticky { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); font-size: 1rem; }
.skc-pi-list { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.skc-pi-divider { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.08); }

.skc-palette-info { display: flex; flex-direction: column; min-width: 0; }
.skc-palette-name { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.skc-palette-desc { font-size: 0.62rem; color: rgba(255,255,255,0.3); }

/* ═══════════════════════════════════════════════════════════
   CANVAS AREA — SVG infinite canvas
   ═══════════════════════════════════════════════════════════ */
.skc-canvas-wrap {
    flex: 1;
    min-width: 0;
    background: rgba(67, 77, 123, 0.52);
    border-radius: 35px;
    padding: 16px;
    position: relative;
}

.skc-canvas {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 28px;
    cursor: grab;
    user-select: none;
}
.skc-canvas:active { cursor: grabbing; }

/* ── Block styling inside SVG ── */
.skc-block { transition: opacity 0.15s; }
.skc-block:hover rect { filter: drop-shadow(0 4px 16px rgba(99,102,241,0.15)) !important; }
.skc-block-selected rect { filter: drop-shadow(0 0 20px rgba(99,102,241,0.2)) !important; }

/* foreignObject textarea styling */
.skc-block textarea {
    scrollbar-width: none;
    caret-color: #a5b4fc;
}
.skc-block textarea::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCTS & ROUTING — Admin Module Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tab Navigation ── */
.prod-tabs {
    display: flex; gap: 4px;
    background: rgba(67,77,123,0.3); border-radius: 14px; padding: 4px;
    width: fit-content;
}
.prod-tab {
    padding: 8px 20px; border-radius: 10px; font-size: 0.85rem;
    background: transparent; border: 1px solid transparent;
    color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.25s;
    font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.prod-tab:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); }
.prod-tab-active {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3);
    color: #a5b4fc; font-weight: 600;
}
.prod-tab-count {
    font-size: 0.7rem; padding: 1px 7px; border-radius: 10px;
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4);
    font-weight: 600; font-family: monospace;
}
.prod-tab-active .prod-tab-count {
    background: rgba(99,102,241,0.2); color: #a5b4fc;
}

/* ── Stats Bar ── */
.prod-stats-bar {
    display: flex; gap: 16px; flex-wrap: wrap;
}
.prod-stat-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px;
    background: rgba(67,77,123,0.25); border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s;
}
.prod-stat-chip:hover { border-color: rgba(99,102,241,0.2); }
.prod-stat-value {
    font-size: 1.2rem; font-weight: 700; color: #fff;
    font-family: 'Inter', sans-serif;
}
.prod-stat-label {
    font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Product Cards Grid ── */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.prod-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: 20px;
    box-shadow: var(--shadow-sm), var(--shadow-inner-glow);
    transition: transform var(--transition-normal),
        border-color var(--transition-normal), box-shadow var(--transition-normal);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 12px;
}
.prod-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--prod-accent, var(--accent)), transparent);
    opacity: 0.5; transition: opacity var(--transition-normal);
}
.prod-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}
.prod-card:hover::before { opacity: 1; }
/* SVG icons (replaced the old emoji). */
.prod-empty-icon svg { width: 40px; height: 40px; color: var(--text-muted); }
.prod-meta-contacts { display: inline-flex; align-items: center; gap: 5px; }
.prod-meta-ic { display: inline-flex; width: 14px; height: 14px; color: var(--text-muted); }
.prod-meta-ic svg { width: 14px; height: 14px; }
.prod-tab-ic { display: inline-flex; align-items: center; width: 15px; height: 15px; margin-right: 6px; }
.prod-tab-ic svg { width: 15px; height: 15px; }
.prod-card-inactive { opacity: 0.5; }

/* Card Header */
.prod-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
}
.prod-card-name {
    font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0;
    line-height: 1.3;
}
.prod-card-sku {
    font-size: 0.7rem; color: rgba(255,255,255,0.3); font-family: monospace;
    margin-top: 2px;
}
.prod-card-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* Price Display */
.prod-price-row {
    display: flex; align-items: baseline; gap: 8px;
}
.prod-price {
    font-size: 1.5rem; font-weight: 700; color: #a5b4fc;
    font-family: 'Inter', sans-serif;
}
.prod-price-model {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.prod-model-once { background: rgba(99,102,241,0.12); color: #a5b4fc; }
.prod-model-monthly { background: rgba(34,197,94,0.12); color: #86efac; }
.prod-model-yearly { background: rgba(234,179,8,0.12); color: #fde68a; }
.prod-model-per_unit { background: rgba(244,114,182,0.12); color: #f9a8d4; }

/* Card Meta */
.prod-card-meta {
    display: flex; gap: 12px; align-items: center;
    padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05);
}
.prod-meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.prod-meta-item svg { width: 14px; height: 14px; }
.prod-category-tag {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.1); color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.15);
}

/* ── Product Create/Edit Form ── */
.prod-form {
    background: rgba(67,77,123,0.15); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 24px; margin-bottom: 20px;
}
.prod-form h3 { margin: 0 0 16px; font-size: 1.1rem; color: #fff; }
.prod-form-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 800px) { .prod-form-grid { grid-template-columns: 1fr; } }

.prod-form-full { grid-column: 1 / -1; }

/* ── Routing Rules ── */
.routing-rules-list {
    display: flex; flex-direction: column; gap: 10px;
}
.routing-rule-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; border-radius: 14px;
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.25s; cursor: grab;
}
.routing-rule-card:hover {
    border-color: rgba(99,102,241,0.3); background: rgba(67,77,123,0.3);
}
.routing-rule-card.dragging {
    opacity: 0.5; border-color: rgba(99,102,241,0.5);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.routing-rule-inactive { opacity: 0.45; }

.routing-drag-handle {
    display: flex; flex-direction: column; gap: 2px;
    color: rgba(255,255,255,0.2); font-size: 1.2rem;
    cursor: grab; user-select: none; flex-shrink: 0;
}
.routing-priority-badge {
    font-size: 0.7rem; font-weight: 700; color: #a5b4fc;
    background: rgba(99,102,241,0.15); padding: 3px 9px;
    border-radius: 8px; font-family: monospace;
    flex-shrink: 0; min-width: 32px; text-align: center;
}
.routing-rule-body { flex: 1; min-width: 0; }
.routing-rule-name {
    font-size: 0.95rem; font-weight: 600; color: #fff; margin: 0 0 4px;
}
.routing-rule-conditions {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;
}
.routing-condition-chip {
    font-size: 0.72rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(234,179,8,0.1); color: #fde68a;
    border: 1px solid rgba(234,179,8,0.15);
}
.routing-action-row {
    display: flex; align-items: center; gap: 8px; font-size: 0.8rem;
}
.routing-action-arrow { color: rgba(255,255,255,0.2); }
.routing-action-target {
    font-size: 0.78rem; padding: 2px 10px; border-radius: 6px;
    background: rgba(34,197,94,0.1); color: #86efac;
    border: 1px solid rgba(34,197,94,0.15);
}
.routing-distribution-badge {
    font-size: 0.68rem; padding: 2px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.1); color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.15); text-transform: uppercase;
}

.routing-rule-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Routing Form ── */
.routing-form {
    background: rgba(67,77,123,0.15); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 24px; margin-bottom: 20px;
}
.routing-form h3 { margin: 0 0 16px; font-size: 1.1rem; color: #fff; }
.routing-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 800px) { .routing-form-grid { grid-template-columns: 1fr; } }

/* Condition builder rows */
.routing-conditions-builder {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.routing-condition-row {
    display: flex; gap: 8px; align-items: center;
}
.routing-condition-row select,
.routing-condition-row input {
    flex: 1;
}
.routing-add-condition {
    font-size: 0.8rem; padding: 6px 14px; border-radius: 8px;
    background: rgba(99,102,241,0.1); border: 1px dashed rgba(99,102,241,0.3);
    color: #a5b4fc; cursor: pointer; transition: all 0.2s;
    width: fit-content;
}
.routing-add-condition:hover { background: rgba(99,102,241,0.2); }

/* ── Empty States ── */
.prod-empty {
    text-align: center; padding: 60px 40px;
    background: rgba(67,77,123,0.1); border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.08);
}
.prod-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.prod-empty h3 { color: rgba(255,255,255,0.5); margin: 0 0 6px; }
.prod-empty p { color: rgba(255,255,255,0.3); font-size: 0.85rem; margin: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT FIELD EDITOR — Per-product intake form builder
   ═══════════════════════════════════════════════════════════════════════════ */

.pf-editor { padding: 0; }

.pf-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px;
}
.pf-title { font-size: 1.15rem; font-weight: 700; color: #fff; margin: 0; }
.pf-subtitle { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin: 4px 0 0; }

.pf-product-select {
    margin-bottom: 24px; padding: 16px 20px;
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
}

/* Empty state */
.pf-empty {
    text-align: center; padding: 60px 40px;
    background: rgba(67,77,123,0.1); border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.08);
}
.pf-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.pf-empty h3 { color: rgba(255,255,255,0.5); margin: 0 0 6px; }
.pf-empty p { color: rgba(255,255,255,0.3); font-size: 0.85rem; margin: 0; }

/* Fields Section */
.pf-fields-section { display: flex; flex-direction: column; gap: 20px; }
.pf-fields-header {
    display: flex; justify-content: space-between; align-items: center;
}
.pf-fields-count {
    font-size: 0.85rem; color: rgba(255,255,255,0.5);
    font-weight: 500;
}

/* Add Form */
.pf-add-form {
    background: rgba(67,77,123,0.2); border: 1px solid rgba(99,102,241,0.2);
    border-radius: 16px; padding: 24px;
    animation: fadeSlideDown 0.25s ease;
}
.pf-add-form h4 { margin: 0 0 16px; color: #a5b4fc; font-size: 1rem; }
.pf-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-bottom: 12px;
}
@media (max-width: 700px) { .pf-form-grid { grid-template-columns: 1fr; } }

.pf-check {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 0.85rem; color: rgba(255,255,255,0.7);
}
.pf-check input[type="checkbox"] {
    accent-color: #6366f1; width: 16px; height: 16px;
}

/* Field Cards */
.pf-field-list {
    display: flex; flex-direction: column; gap: 8px;
}
.pf-field-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; border-radius: 14px;
    background: rgba(67,77,123,0.2); border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.25s;
}
.pf-field-card:hover {
    border-color: rgba(99,102,241,0.25); background: rgba(67,77,123,0.3);
}
.pf-field-num {
    font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.2);
    font-family: monospace; width: 28px; text-align: center; flex-shrink: 0;
}
.pf-field-icon {
    flex-shrink: 0; width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.pf-field-icon svg { width: 18px; height: 18px; }
/* SVG icons that replaced emoji (empty-state + preview-title). */
.pf-empty-icon svg { width: 40px; height: 40px; color: var(--text-muted); }
.pf-preview-title { display: inline-flex; align-items: center; gap: 8px; }
.pf-preview-ic { display: inline-flex; width: 16px; height: 16px; color: var(--text-secondary); }
.pf-preview-ic svg { width: 16px; height: 16px; }
.pf-field-body { flex: 1; min-width: 0; }
.pf-field-label {
    font-size: 0.92rem; font-weight: 600; color: #fff;
}
.pf-field-meta {
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap; margin-top: 4px;
}
.pf-field-type-badge {
    font-size: 0.68rem; padding: 1px 8px; border-radius: 6px;
    background: rgba(99,102,241,0.12); color: #a5b4fc;
    font-weight: 600; letter-spacing: 0.02em;
}
.pf-field-fname {
    font-size: 0.7rem; color: rgba(255,255,255,0.25); font-family: monospace;
}
.pf-badge-required {
    font-size: 0.65rem; padding: 1px 8px; border-radius: 6px;
    background: rgba(239,68,68,0.12); color: #fca5a5;
    font-weight: 600; text-transform: uppercase;
}
.pf-field-ph {
    font-size: 0.7rem; color: rgba(255,255,255,0.2); font-style: italic;
}
.pf-field-help {
    font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-top: 3px;
}
.pf-field-actions {
    display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}

/* Toggle Button */
.toggle-btn {
    font-size: 0.68rem; padding: 3px 10px; border-radius: 8px;
    cursor: pointer; transition: all 0.2s; font-weight: 600;
    border: 1px solid;
}
.toggle-on {
    background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.2);
    color: #fca5a5;
}
.toggle-off {
    background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
}
.toggle-btn:hover { filter: brightness(1.2); }

/* Live Preview */
.pf-preview {
    background: rgba(67,77,123,0.15); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 20px;
}
.pf-preview-title {
    font-size: 0.95rem; font-weight: 600; color: rgba(255,255,255,0.6);
    margin: 0 0 16px;
}
.pf-preview-form {
    display: flex; flex-direction: column; gap: 14px;
}
.pf-preview-field { display: flex; flex-direction: column; gap: 6px; }
.pf-preview-label {
    font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.6);
}
.pf-preview-req { color: #ef4444; margin-left: 2px; }
.pf-preview-help {
    font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 2px;
}

/* Slide-Out Panel */
.pf-slide-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9000;
}
.pf-slide-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 380px;
    background: rgba(20,24,44,0.98); border-left: 1px solid rgba(255,255,255,0.08);
    z-index: 9001; display: flex; flex-direction: column;
    animation: slideInRight 0.3s ease;
}
.pf-slide-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pf-slide-header h3 { margin: 0; font-size: 1rem; color: #fff; }
.pf-slide-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pf-slide-footer {
    padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; gap: 10px; justify-content: flex-end;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   ROUTING PROPERTIES MODAL — Draggable popup
   ═══════════════════════════════════════════════════════════════════════════ */

.routing-props-overlay {
    position: fixed; inset: 0;
    z-index: 1200;
    background: transparent;
}

.routing-props-modal {
    position: fixed;
    width: 340px;
    max-height: 480px;
    border-radius: 16px;
    background: rgba(22, 26, 48, 0.97);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: propsModalIn 0.2s ease-out;
    z-index: 1201;
}

@keyframes propsModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.routing-props-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    cursor: grab;
    user-select: none;
    background: rgba(99, 102, 241, 0.05);
}
.routing-props-header:active { cursor: grabbing; }

.routing-props-header-left {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
}

.routing-props-icon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 8px; flex-shrink: 0;
    color: rgba(255,255,255,0.7);
}
.routing-props-icon svg { width: 16px; height: 16px; }

.routing-props-type {
    font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; opacity: 0.8; margin-bottom: 2px;
}

.routing-props-name-input {
    background: transparent; border: none; outline: none;
    color: #fff; font-size: 14px; font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    width: 100%; padding: 2px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    cursor: text;
}
.routing-props-name-input:focus {
    border-bottom-color: rgba(99, 102, 241, 0.5);
}

.routing-props-close {
    background: rgba(255,255,255,0.06); border: none;
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,0.4);
    transition: all 0.2s; flex-shrink: 0;
}
.routing-props-close:hover {
    background: rgba(239, 68, 68, 0.15); color: #ef4444;
}
.routing-props-close svg { width: 14px; height: 14px; }

.routing-props-body {
    padding: 16px;
    overflow-y: auto; max-height: 340px;
}

.routing-props-section {
    margin-bottom: 14px;
}

.routing-props-label {
    display: block; font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,0.45); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 6px;
}

.routing-props-input {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff;
    font-size: 13px; font-family: 'Inter', system-ui, sans-serif;
    outline: none; transition: all 0.2s;
    box-sizing: border-box;
}
.routing-props-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.routing-props-input {
    appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='white' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}
select.routing-props-input option {
    background: #1a1e36; color: #fff;
}

.routing-props-hint {
    font-size: 11px; color: rgba(255,255,255,0.3);
    margin-top: 6px; line-height: 1.4;
}

/* ── Searchable Field Picker ── */
.routing-props-search {
    font-size: 12px !important;
    padding: 6px 10px !important;
    margin-bottom: 4px;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,0.03) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.routing-props-search:focus {
    border-color: rgba(99,102,241,0.5) !important;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
    outline: none;
}
.routing-props-search::placeholder {
    color: rgba(255,255,255,0.25);
    font-size: 11px;
}

/* ── Category dot (replaces emoji circles) ── */
.cat-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════
   Call Grid Editor — Admin panel for configuring call layouts
   Uses CRM design tokens from _tokens.css
   Extends dashboard-editor de-* base classes
   ══════════════════════════════════════════════════════════════ */

/* ── Root — force fit viewport ──────────────────────────────── */
.cge-root {
    height: calc(100vh - 160px) !important;
    min-height: 0;
    overflow: hidden;
}
.cge-root .de-canvas {
    min-height: 0;
    overflow: hidden;
}

/* Override grid-cell to not force min-height */
.cge-root .de-grid-cell {
    min-height: 0;
}

/* ── Widget badge in header (SVG icon) ──────────────────────── */
.cge-widget-badge {
    margin-left: auto;
    margin-right: 4px;
    color: var(--text-muted, #64748b);
    display: flex; align-items: center;
    opacity: 0.6;
}
.cge-widget-badge svg { width: 16px; height: 16px; }

/* ── Widget preview body ────────────────────────────────────── */
.cge-widget-preview-body {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 12px 8px;
}
.cge-preview-icon {
    color: var(--text-accent, #a5b4fc);
    display: flex; align-items: center; justify-content: center;
}
.cge-preview-icon svg { width: 36px; height: 36px; }
.cge-preview-type {
    font-size: 0.7rem; font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cge-preview-size {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-variant-numeric: tabular-nums;
}
.cge-preview-min {
    font-size: 0.6rem;
    color: rgba(99,102,241,0.5);
    font-style: italic;
}

/* ── Creator Modal ──────────────────────────────────────────── */
.cge-creator-modal {
    max-width: 580px;
    background: var(--glass-bg-solid, rgba(12,18,34,0.97));
    border: 1px solid var(--glass-border, rgba(148,163,184,0.07));
}
.cge-creator-body { padding: 20px; }
.cge-creator-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 16px;
}
.cge-creator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; margin-bottom: 20px;
}
.cge-pal-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 18px 10px;
    background: var(--bg-card, rgba(12,18,34,0.75));
    border: 2px solid var(--glass-border, rgba(148,163,184,0.07));
    border-radius: var(--radius-md, 12px);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer; transition: all 0.2s;
}
.cge-pal-card:hover {
    background: var(--accent-soft, rgba(99,102,241,0.12));
    border-color: rgba(99,102,241,0.25);
    color: var(--text-primary, #f1f5f9);
}
.cge-pal-card.selected {
    background: var(--accent-glow, rgba(99,102,241,0.2));
    border-color: rgba(99,102,241,0.5);
    color: var(--text-primary, #f1f5f9);
    box-shadow: var(--shadow-glow);
}
.cge-pal-icon {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-accent, #a5b4fc);
}
.cge-pal-icon svg { width: 32px; height: 32px; }
.cge-pal-label { font-size: 0.8rem; font-weight: 600; }
.cge-pal-size {
    font-size: 0.6rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}
.cge-creator-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    border-top: 1px solid var(--glass-border, rgba(148,163,184,0.07));
    padding-top: 12px;
}

/* ── Editor modal — type grid ───────────────────────────────── */
.cge-edit-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
.cge-edit-type-btn {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 10px 6px;
    background: var(--bg-card, rgba(12,18,34,0.75));
    border: 2px solid var(--glass-border, rgba(148,163,184,0.07));
    border-radius: var(--radius-sm, 8px);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer; transition: all 0.2s;
    font-size: 0.7rem;
}
.cge-edit-type-btn:hover {
    background: var(--accent-soft, rgba(99,102,241,0.12));
    border-color: rgba(99,102,241,0.2);
    color: var(--text-primary, #f1f5f9);
}
.cge-edit-type-btn.active {
    background: var(--accent-glow, rgba(99,102,241,0.2));
    border-color: rgba(99,102,241,0.5);
    color: var(--text-primary, #f1f5f9);
}
.cge-edit-type-icon {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-accent, #a5b4fc);
}
.cge-edit-type-icon svg { width: 20px; height: 20px; }
.cge-edit-type-label { font-weight: 600; }

.cge-edit-minsize {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    padding: 6px 10px;
    background: var(--bg-input, rgba(12,18,34,0.5));
    border-radius: var(--radius-sm, 8px);
}

/* ── Input field ────────────────────────────────────────────── */
.de-edit-input {
    width: 100%; padding: 8px 12px;
    background: var(--bg-input, rgba(12,18,34,0.5));
    border: 1px solid var(--glass-border, rgba(148,163,184,0.07));
    border-radius: var(--radius-sm, 8px);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.85rem;
    outline: none; transition: border-color var(--transition-fast, 150ms);
    font-family: inherit;
}
.de-edit-input:focus {
    border-color: var(--glass-border-hover, rgba(99,102,241,0.35));
}
