/**
 * FlowPath CRM — Portal CSS v2.6.10
 * Mobile First · DM Sans · Xiaomi Redmi Tablet optimiert
 *
 * v2.6.10: Wochenansicht-Pille proportional zur Termin-Dauer (position:absolute).
 * v2.6.9:  Tagesansicht & Dashboard auf Listen-Modell (Termine + freie Blöcke + Kommende),
 *          Monats-Overflow-Fix (.fpc-cal-day { min-width: 0; }).
 *
 * FIXES v2.0.1:
 * - Input font-size >= 16px überall (verhindert Android-Zoom beim Tippen)
 * - touch-action: manipulation auf allen Buttons (kein 300ms Tap-Delay)
 * - -webkit-tap-highlight-color: transparent
 * - safe-area-inset für Bottom Nav (Android Gestennavigation)
 * - overscroll-behavior auf Portal-Container
 */

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:        #1a8a8a;
    --primary-light:  #e8f6f6;
    --primary-dark:   #14706e;
    --accent:         #f5a623;
    --success:        #27ae60;
    --success-light:  #eafaf1;
    --warning:        #e67e22;
    --warning-light:  #fef9f0;
    --danger:         #e74c3c;
    --danger-light:   #fdf0ef;
    --text:           #2c3e50;
    --text-muted:     #7f8c8d;
    --bg:             #f4f6f8;
    --card:           #ffffff;
    --border:         #e8ecf0;
    --shadow:         0 2px 12px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 20px rgba(0,0,0,0.10);
    --radius:         12px;
    --radius-sm:      8px;
    --nav-height:     64px;
    /* Safe area für Android Gestenleiste */
    --safe-bottom:    env(safe-area-inset-bottom, 0px);
}

body.fpc-portal-body,
html.fpc-portal-body body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%; /* verhindert Auto-Zoom nach Orientierungswechsel */
    overflow-x: hidden;
}

/* v2.0.4 P5: ALLES ausblenden was nicht zum Portal gehört */
/* Aggressiv: Theme-Header, -Footer, -Sidebar, WP-Admin-Bar, Hamburger — egal welches Theme */
/* v2.2.5: Selektoren für body.fpc-portal-body UND html.fpc-portal-body (JS-Fallback) */
body.fpc-portal-body #masthead,
html.fpc-portal-body #masthead,
body.fpc-portal-body .site-header,
html.fpc-portal-body .site-header,
body.fpc-portal-body .site-footer,
html.fpc-portal-body .site-footer,
body.fpc-portal-body #colophon,
html.fpc-portal-body #colophon,
body.fpc-portal-body .kadence-mobile-header,
html.fpc-portal-body .kadence-mobile-header,
body.fpc-portal-body .mobile-header-navigation,
html.fpc-portal-body .mobile-header-navigation,
body.fpc-portal-body .mobile-toggle-open,
html.fpc-portal-body .mobile-toggle-open,
body.fpc-portal-body .kadence-sticky-header,
html.fpc-portal-body .kadence-sticky-header,
body.fpc-portal-body .header-mobile-sidebar,
html.fpc-portal-body .header-mobile-sidebar,
body.fpc-portal-body .mobile-header-nav-wrap,
html.fpc-portal-body .mobile-header-nav-wrap,
body.fpc-portal-body #wpadminbar,
html.fpc-portal-body #wpadminbar,
body.fpc-portal-body .wp-site-blocks > header,
html.fpc-portal-body .wp-site-blocks > header,
body.fpc-portal-body .wp-site-blocks > footer,
html.fpc-portal-body .wp-site-blocks > footer,
body.fpc-portal-body .site-branding-container,
html.fpc-portal-body .site-branding-container,
body.fpc-portal-body .navigation-toggle-wrap,
html.fpc-portal-body .navigation-toggle-wrap,
body.fpc-portal-body .site-header-wrap,
html.fpc-portal-body .site-header-wrap,
body.fpc-portal-body .header-navigation-wrap,
html.fpc-portal-body .header-navigation-wrap,
body.fpc-portal-body .popup-drawer,
html.fpc-portal-body .popup-drawer,
body.fpc-portal-body .mobile-navigation,
html.fpc-portal-body .mobile-navigation,
body.fpc-portal-body .mobile-nav-wrap,
html.fpc-portal-body .mobile-nav-wrap,
body.fpc-portal-body .header-toggle-sidebar,
html.fpc-portal-body .header-toggle-sidebar,
body.fpc-portal-body .drawer-overlay,
html.fpc-portal-body .drawer-overlay,
body.fpc-portal-body nav.main-navigation,
html.fpc-portal-body nav.main-navigation,
body.fpc-portal-body .site-above-header-wrap,
html.fpc-portal-body .site-above-header-wrap,
body.fpc-portal-body .site-header-upper-wrap,
html.fpc-portal-body .site-header-upper-wrap,
body.fpc-portal-body .site-header-lower-wrap,
html.fpc-portal-body .site-header-lower-wrap,
body.fpc-portal-body .site-bottom-header-wrap,
html.fpc-portal-body .site-bottom-header-wrap,
body.fpc-portal-body .footer-widget-area,
html.fpc-portal-body .footer-widget-area,
body.fpc-portal-body .site-footer-wrap,
html.fpc-portal-body .site-footer-wrap {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
body.fpc-portal-body .site-content,
html.fpc-portal-body .site-content,
body.fpc-portal-body .content-area,
html.fpc-portal-body .content-area,
body.fpc-portal-body .entry-content,
html.fpc-portal-body .entry-content,
body.fpc-portal-body .site,
html.fpc-portal-body .site,
body.fpc-portal-body .site-inner,
html.fpc-portal-body .site-inner,
body.fpc-portal-body .hentry,
html.fpc-portal-body .hentry {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
/* WordPress Admin Bar Platz entfernen */
html.fpc-portal-body,
body.fpc-portal-body { margin-top: 0 !important; padding-top: 0 !important; }

/* Alle interaktiven Elemente: kein blaues Highlight auf Android */
a, button, input, select, textarea, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

/* Alle Buttons: touch-action + kein iOS/Android Kontext-Menü bei Long-Press */
button {
    touch-action: manipulation;
    -webkit-touch-callout: none; /* v2.2.7: verhindert "Bild herunterladen" bei Emoji-Buttons */
    user-select: none;
    -webkit-user-select: none;
}
a {
    -webkit-touch-callout: none;
}

/* =====================================================
   PORTAL WRAPPER
   ===================================================== */
.fpc-portal {
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    max-width: 960px;
    margin: 0 auto;
    overscroll-behavior-y: contain;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .fpc-portal {
        display: grid;
        grid-template-columns: 200px minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        padding-bottom: 0;
        padding-left: 12px;   /* v2.4.7.2: Mika-Wunsch — Sidebar 12px vom Fensterrand */
        padding-right: 16px;
        max-width: 100%;      /* v2.4.7.2: keine 1200px-Begrenzung mehr */
        margin: 0;            /* v2.4.7.2: kein Auto-Centering */
    }
}

/* =====================================================
   SCREENS (SPA)
   ===================================================== */
.fpc-screen {
    display: none;
    padding: 16px;
    animation: fpcFadeIn 0.18s ease;
    overflow: visible; /* v2.2.9: Kanban darf horizontal überlaufen */
}
.fpc-screen.is-active { display: block; }

@keyframes fpcFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) { .fpc-screen { padding: 24px; } }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .fpc-screen { padding: 24px 20px; grid-column: 2; min-width: 0; }
    /* v2.4.7.2: min-width:0 verhindert Overflow im Grid-Track */
}

/* =====================================================
   SCREEN HEADER
   ===================================================== */
.fpc-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    position: relative;
    z-index: 50; /* v2.2.5: erhöht */
    isolation: isolate; /* v2.2.5: eigener Stacking Context */
}
.fpc-screen-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* v2.2.1: Logout-Button wie EPT */
.fpc-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none; /* v2.2.7 */
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
    margin-left: 4px;
}
.fpc-logout-btn svg { pointer-events: none; }
.fpc-logout-btn:hover,
.fpc-logout-btn:active { background: var(--danger); transform: scale(0.95); text-decoration: none; color: #fff; }

/* =====================================================
   BOTTOM NAV (Mobile/Tablet) / SIDEBAR (Desktop)
   ===================================================== */
.fpc-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Höhe + Safe Area für Android-Gestenleiste */
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-left: 4px;
    padding-right: 4px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.fpc-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    /* Mindest-Touch-Target 44px */
    min-height: 48px;
    min-width: 44px;
    border-radius: 10px;
    position: relative;
    transition: color 0.12s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.fpc-nav-item.is-active { color: var(--primary); }
.fpc-nav-item.is-active .fpc-nav-icon {
    background: var(--primary-light);
    border-radius: 8px;
}
.fpc-nav-icon {
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}
.fpc-nav-label { line-height: 1; user-select: none; }
.fpc-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.fpc-nav-badge--warning { background: var(--warning); }

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .fpc-nav {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        border-top: none;
        border-right: 1px solid var(--border);
        padding: 16px 6px;        /* v2.4.7.2: war 24px 12px — schlanker */
        gap: 2px;                  /* war 4px */
        box-shadow: none;
        grid-column: 1;
        grid-row: 1 / -1;
        overflow-y: auto;
        padding-bottom: 16px;
    }
    .fpc-nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;                  /* war 10px */
        padding: 9px 10px;         /* war 10px 12px */
        font-size: 14px;
        border-radius: var(--radius-sm);
    }
    .fpc-nav-item.is-active {
        background: var(--primary-light);
        color: var(--primary);
    }
    .fpc-nav-item.is-active .fpc-nav-icon { background: none; }
    .fpc-nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
    .fpc-nav-badge { position: static; margin-left: auto; }
    .fpc-nav::before {
        content: 'FlowPath CRM';
        display: block;
        font-size: 15px;
        font-weight: 700;
        color: var(--primary);
        padding: 4px 10px 14px;    /* v2.4.7.2: kompakter */
        border-bottom: 1px solid var(--border);
        margin-bottom: 10px;
    }
}

/* =====================================================
   BUTTONS
   ===================================================== */
.fpc-btn-primary,
.fpc-btn-secondary,
.fpc-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px; /* >= 16px wäre ideal, 15px ist akzeptabel für Buttons */
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.12s, opacity 0.12s;
    min-height: 48px; /* grosses Touch-Target */
    white-space: nowrap;
    touch-action: manipulation;
    user-select: none;
}
.fpc-btn-primary  { background: var(--primary); color: #fff; }
.fpc-btn-primary:hover, .fpc-btn-primary:active { background: var(--primary-dark); }
.fpc-btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.fpc-btn-secondary:hover, .fpc-btn-secondary:active { background: var(--border); }
.fpc-btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #e74c3c30; }
.fpc-btn-danger:hover, .fpc-btn-danger:active { background: var(--danger); color: #fff; }
.fpc-btn-sm { padding: 8px 14px; font-size: 14px; min-height: 40px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================================================
   CARDS
   ===================================================== */
.fpc-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

/* KPI Grid */
.fpc-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
.fpc-kpi-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    cursor: pointer;
    touch-action: manipulation;
    transition: box-shadow 0.12s;
    /* Mindest-Touch-Target */
    min-height: 80px;
}
.fpc-kpi-card:active { box-shadow: var(--shadow-md); }
.fpc-kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.fpc-kpi-value { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1.2; }
.fpc-kpi-value--primary { color: var(--primary); }
.fpc-kpi-value--success { color: var(--success); }
.fpc-kpi-progress { margin-top: 8px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.fpc-kpi-progress-bar { height: 100%; background: var(--success); border-radius: 2px; transition: width 0.5s ease; }
.fpc-kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =====================================================
   SECTIONS
   ===================================================== */
.fpc-section { margin-bottom: 24px; }
.fpc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.fpc-section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.fpc-section-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    /* Mindest-Touch-Target */
    min-height: 44px;
    min-width: 44px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
}

/* =====================================================
   DEAL CARDS
   ===================================================== */
.fpc-deal-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    touch-action: manipulation;
    border-left: 3px solid transparent;
    /* verhindert Text-Selektion beim langen Drücken */
    -webkit-user-select: none;
    user-select: none;
}
.fpc-deal-card:active { box-shadow: var(--shadow-md); }
.fpc-deal-card--lead        { border-left-color: #95a5a6; }
.fpc-deal-card--qualified   { border-left-color: #3498db; }
.fpc-deal-card--proposal    { border-left-color: #9b59b6; }
.fpc-deal-card--negotiation { border-left-color: #f39c12; }
.fpc-deal-card--won         { border-left-color: #27ae60; }
.fpc-deal-card--lost        { border-left-color: #e74c3c; }
.fpc-deal-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fpc-deal-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }
.fpc-deal-value { font-size: 15px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.fpc-deal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fpc-deal-customer { font-size: 13px; color: var(--text-muted); }
.fpc-deal-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* =====================================================
   CUSTOMER CARDS
   ===================================================== */
.fpc-customer-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    touch-action: manipulation;
    min-height: 68px;
    -webkit-user-select: none;
    user-select: none;
}
.fpc-customer-card:active { box-shadow: var(--shadow-md); }
.fpc-customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}
.fpc-customer-info { flex: 1; min-width: 0; }
.fpc-customer-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpc-customer-contact { font-size: 12px; color: var(--primary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpc-customer-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* v2.2.2: Actions-Bereich rechts */
.fpc-customer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.fpc-customer-deals-badge { background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; white-space: nowrap; cursor: pointer; }
.fpc-customer-btns { display: flex; gap: 4px; }
.fpc-action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, color 0.12s;
    padding: 0;
    font-family: inherit;
}
.fpc-action-icon-btn svg { pointer-events: none; }
.fpc-action-icon-btn:active { background: var(--primary-light); color: var(--primary); }
.fpc-msg-btn { opacity: 0.4; cursor: default; }
@media (min-width: 768px) {
    .fpc-action-icon-btn { width: 40px; height: 40px; min-width: 40px; }
}

/* =====================================================
   DOCUMENT CARDS
   ===================================================== */
.fpc-document-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    touch-action: manipulation;
    min-height: 68px;
    -webkit-user-select: none;
    user-select: none;
}
.fpc-document-card:active { box-shadow: var(--shadow-md); }
.fpc-document-card--pending { border-left: 3px solid var(--warning); }
.fpc-document-info { flex: 1; min-width: 0; }
.fpc-document-number { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.fpc-document-customer { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v2.4.8.1: Verkäufer-Name unter Kunde — nur wenn Manager fremde Dokumente sieht */
.fpc-document-creator { font-size: 12px; color: var(--text-muted, #64748b); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpc-document-amount { font-size: 15px; font-weight: 700; color: var(--text); text-align: right; white-space: nowrap; }

/* =====================================================
   BADGES
   ===================================================== */
.fpc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* =====================================================
   FILTER BAR
   ===================================================== */
.fpc-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.fpc-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    /* scroll-snap für präzise Bedienung */
    scroll-snap-type: x proximity;
}
.fpc-filter-scroll::-webkit-scrollbar { display: none; }
.fpc-filter-select {
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px; /* >= 16px: kein Android-Zoom */
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-appearance: none;
    touch-action: manipulation;
}
.fpc-filter-select:focus { outline: none; border-color: var(--primary); }

.fpc-filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.fpc-filter-chips::-webkit-scrollbar { display: none; }
.fpc-filter-chips--scrollable { flex-wrap: nowrap; }

.fpc-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px;
    min-width: 44px;
    transition: all 0.12s;
    touch-action: manipulation;
    scroll-snap-align: start;
}
.fpc-chip.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.fpc-chip-divider { width: 1px; background: var(--border); margin: 0 4px; align-self: stretch; flex-shrink: 0; }

.fpc-view-toggle { display: flex; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.fpc-view-btn {
    padding: 0 14px;
    background: var(--card);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.fpc-view-btn.is-active { background: var(--primary-light); color: var(--primary); }

/* =====================================================
   SEARCH BAR
   ===================================================== */
.fpc-search-bar { margin-bottom: 16px; }
.fpc-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.fpc-search-icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.fpc-search-input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    /* KRITISCH: >= 16px verhindert Android-Zoom beim Fokus */
    font-size: 16px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border-color 0.12s;
    -webkit-appearance: none;
    min-height: 48px;
}
.fpc-search-input:focus { outline: none; border-color: var(--primary); }
.fpc-search-clear {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* =====================================================
   TIMELINE
   ===================================================== */
.fpc-timeline { display: flex; flex-direction: column; gap: 8px; }
.fpc-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    min-height: 52px;
    touch-action: manipulation;
}
.fpc-timeline-item:active { box-shadow: var(--shadow-md); }
.fpc-timeline-time { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; min-width: 44px; padding-top: 2px; }
.fpc-timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.fpc-timeline-dot--call     { background: var(--accent); }
.fpc-timeline-dot--task     { background: var(--success); }
.fpc-timeline-dot--demo     { background: #9b59b6; }
.fpc-timeline-dot--followup { background: var(--warning); }
.fpc-timeline-content { flex: 1; }
.fpc-timeline-title { font-size: 14px; font-weight: 600; color: var(--text); }
.fpc-timeline-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   KALENDER
   ===================================================== */

/* =====================================================
   KALENDER v2.3.0 — Toolbar, Nav, Views
   ===================================================== */
.fpc-cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.fpc-cal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fpc-cal-nav-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background 0.12s;
}
/* v2.3.5: CSS-Pfeile — kein SVG, kein Rendering-Problem */
.fpc-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-top: 2.5px solid #fff;
    border-right: 2.5px solid #fff;
    pointer-events: none;
    flex-shrink: 0;
}
.fpc-arrow--left  { transform: rotate(-135deg) translate(-1px, 1px); }
.fpc-arrow--right { transform: rotate(45deg) translate(-1px, 1px); }
.fpc-cal-nav-btn:hover,
.fpc-cal-nav-btn:active { background: var(--primary-dark); }
.fpc-cal-today-btn {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
}
.fpc-cal-today-btn:hover,
.fpc-cal-today-btn:active { border-color: var(--primary); color: var(--primary); }

/* Monatsansicht */
.fpc-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    text-align: center;
}
.fpc-cal-weekdays span { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.fpc-cal-weekend { color: var(--danger) !important; opacity: 0.7; }

.fpc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 20px;
}
.fpc-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px 2px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    min-height: 40px;
    min-width: 0; /* v2.6.9: verhindert Auswachsen über 1fr durch lange Event-Titel */
    overflow: hidden; /* v2.6.9: Pills bleiben in der Zelle */
    border: 1.5px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.fpc-cal-day:active { background: var(--primary-light); }
.fpc-cal-day--today { background: var(--primary-light); border-color: var(--primary); }
.fpc-cal-day--today .fpc-cal-day-num { color: var(--primary); font-weight: 700; }
.fpc-cal-day--selected { background: var(--primary); }
.fpc-cal-day--selected .fpc-cal-day-num { color: #fff !important; font-weight: 700; }
.fpc-cal-day--other-month { opacity: 0.35; }
.fpc-cal-day--weekend .fpc-cal-day-num { color: var(--danger); }
.fpc-cal-day-num { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1; }

/* v2.3.2: Event-Titel in Monatszellen */
.fpc-cal-day {
    aspect-ratio: unset;
    min-height: 56px;
}
.fpc-cal-day-events-mini {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 3px;
}
.fpc-cal-month-ev {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    border-radius: 2px;
    padding: 1px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    line-height: 1.4;
}
.fpc-cal-month-more {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}
@media (min-width: 480px) {
    .fpc-cal-month-ev { font-size: 10px; }
}

.fpc-cal-day-events {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.fpc-cal-day-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.fpc-cal-upcoming { margin-top: 8px; }

/* =====================================================
   TAGESANSICHT — Timeline
   ===================================================== */
.fpc-cal-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.fpc-cal-slot {
    display: flex;
    min-height: 56px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
    transition: background 0.1s;
}
.fpc-cal-slot:last-child { border-bottom: none; }
.fpc-cal-slot:active,
.fpc-cal-slot--empty:active { background: var(--primary-light); }
.fpc-cal-slot-time {
    width: 52px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 8px 0 10px;
    border-right: 1px solid var(--border);
    background: var(--bg);
}
.fpc-cal-slot-content {
    flex: 1;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fpc-cal-slot-add {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.fpc-cal-slot:hover .fpc-cal-slot-add { opacity: 1; }
.fpc-cal-event-pill {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    touch-action: manipulation;
}
.fpc-cal-event-pill-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.fpc-cal-event-pill-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.fpc-cal-event-pill-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* =====================================================
   WOCHENANSICHT
   ===================================================== */
.fpc-cal-week-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}
.fpc-cal-week-table {
    display: grid;
    grid-template-columns: 44px repeat(7, 1fr);
    gap: 0;
    /* v2.7.2: min-width auf 560px erhöht — gibt jeder Wochenspalte ~74 px,
       was auf Mobile-Phone (Viewport ~375 px) ein angenehmer horizontaler
       Scroll ist statt zu schmaler Spalten. Auf Desktop wirkt sich das
       nicht aus, weil dort die Tabelle ohnehin die volle Breite nutzt. */
    min-width: 560px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card);
}
.fpc-cal-week-header {
    background: var(--bg);
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.fpc-cal-week-header.fpc-cal-week-header--today {
    color: var(--primary);
    font-weight: 700;
}
.fpc-cal-week-header-num {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 2px;
}
.fpc-cal-week-header.fpc-cal-week-header--today .fpc-cal-week-header-num {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2px;
}
.fpc-cal-week-timecol {
    background: var(--bg);
    border-right: 1px solid var(--border);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 2px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.fpc-cal-week-cell {
    min-height: 44px;
    /* v2.7.2: min-width: 0 — sonst kann der Pill-Inhalt (auch wenn position:
       absolute) durch andere Faktoren das Grid auf eine feste Mindestbreite
       zwingen. min-width: 0 ist auf Grid-Items mit 1fr immer sicherer als
       der Default 'auto'. */
    min-width: 0;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 3px;
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
    transition: background 0.1s;
}
.fpc-cal-week-cell:active { background: var(--primary-light); }
.fpc-cal-week-cell--today { background: var(--primary-light); }
.fpc-cal-week-pill {
    /* v2.6.10: Position absolute — Höhe & Top kommen inline aus JS,
       sodass die Pille proportional zur Termin-Dauer über mehrere Stunden ragt.
       Linke + rechte Begrenzung durch left/right (Side-by-Side bei Überlappung
       überschreibt das mit width/left inline). */
    position: absolute;
    left: 2px;
    right: 2px;
    /* top + height inline */
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    padding: 3px 5px;
    z-index: 2;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
    transition: transform 0.1s, box-shadow 0.1s;
}
.fpc-cal-week-pill:active {
    transform: scale(0.98);
    box-shadow: 0 1px 1px rgba(0,0,0,0.18);
}
.fpc-cal-week-pill-time {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.fpc-cal-week-pill-title {
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    /* Mehrzeilig erlauben wenn Pille hoch genug ist (langer Termin) */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    /* v2.7.2: word-break: break-all statt break-word — bei langen Titeln
       OHNE Leerzeichen (z. B. „BugfixingVKPortalNeueWunschliste") sorgt
       break-all dafür, dass der Text mitten im Wort umbricht und die
       Pille nicht in die Breite drängt. */
    word-break: break-all;
    overflow-wrap: anywhere;
}
/* v2.6.11: mehrtägige Events — Marker oben rechts in der Pille */
.fpc-cal-week-pill--multi {
    border: 1px dashed rgba(255,255,255,0.55);
}
.fpc-cal-week-pill-multi {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.85;
    pointer-events: none;
}

/* v2.7.0: Drag & Drop Feedback */
.fpc-cal-week-pill--draggable {
    cursor: grab;
    /* v2.7.1: Native Touch-Gesten (Scroll/Long-Press-Menu/Selection) auf der
       Pille verhindern. Sonst kann iOS/Android den Long-Press abbrechen. */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.fpc-cal-week-pill--draggable:active {
    cursor: grabbing;
}
.fpc-cal-week-pill--dragging {
    cursor: grabbing;
    will-change: transform;
}
.fpc-cal-week-cell--drag-over {
    background: rgba(26, 138, 138, 0.18) !important;
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* v2.7.1: Live-Time-Hint neben Cursor während Drag */
.fpc-cal-drag-hint {
    position: fixed;
    z-index: 100000;
    pointer-events: none;
    background: var(--text);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transform: translateZ(0);
    transition: opacity 0.1s;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* v2.7.3: Ganztägige Termine — eigene Zeile zwischen Header und Stunden-Grid */
.fpc-cal-week-allday-label {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 2px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fpc-cal-week-allday-cell {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 3px 2px;
    min-height: 24px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fpc-cal-week-allday-cell--today {
    background: var(--primary-light);
}
.fpc-cal-week-allday-pill {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.fpc-cal-week-allday-pill:active {
    opacity: 0.8;
}

/* v2.6.11: mehrtägige Events in der Tagesansicht — kleiner Hinweis */
.fpc-day-event-multi {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    margin-top: 2px;
    font-style: italic;
}

/* v2.6.11: Form-Hint hinter Labels (z. B. „optional") */
.fpc-form-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

/* =====================================================
   v2.6.9 — TAGESANSICHT (Listen-Modell)
   ===================================================== */

/* Sektionen (Termine / Freie Blöcke / Kommende Termine) */
.fpc-day-section {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 14px 12px;
    margin-bottom: 12px;
}
.fpc-day-section--compact { padding: 10px 12px; box-shadow: none; }

.fpc-day-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.fpc-day-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0 0 10px;
}
.fpc-day-section-head .fpc-day-section-title { margin: 0; }
.fpc-day-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 0 2px;
}

/* Termin-Karten in der Tagesansicht */
.fpc-day-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fpc-day-event {
    border-left: 3px solid var(--primary);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.12s;
}
.fpc-day-event:active { background: var(--primary-light); }
.fpc-day-event-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}
.fpc-day-event-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.fpc-day-event-dur {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.fpc-day-event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin: 2px 0;
}
.fpc-day-event-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 1px;
}

/* Freie Zeitblöcke (klickbar → neuer Termin) */
.fpc-day-free-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fpc-day-free-block {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    font-family: inherit;
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
    min-height: 40px;
}
.fpc-day-free-block:hover,
.fpc-day-free-block:active {
    background: var(--primary-light);
    border-color: var(--primary);
    border-style: solid;
}
.fpc-day-free-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 110px;
}
.fpc-day-free-dur {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
}
.fpc-day-free-add {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* Kommende Termine (gemeinsam für Tag- + Wochenansicht) */
#fpcCalWeekUpcoming { margin-top: 14px; }

.fpc-day-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fpc-day-upcoming-item {
    border-left: 3px solid var(--primary);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.12s;
}
.fpc-day-upcoming-item:active { background: var(--primary-light); }
.fpc-day-upcoming-when {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.fpc-day-upcoming-date {
    font-weight: 600;
    color: var(--text);
}
.fpc-day-upcoming-time {
    font-variant-numeric: tabular-nums;
}
.fpc-day-upcoming-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.fpc-day-upcoming-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Skeleton für Dashboard-Timeline */
.fpc-day-skeleton { padding: 4px 0; }

/* Dashboard kompakter */
#fpcDashTimeline.fpc-day-list { padding: 0; }
#fpcDashTimeline .fpc-day-event,
#fpcDashTimeline .fpc-day-free-block { background: var(--card); }

/* Mobile: Sektion-Padding leicht reduzieren */
@media (max-width: 480px) {
    .fpc-day-section { padding: 12px 12px 10px; }
    .fpc-day-event { padding: 9px 10px; }
    .fpc-day-free-time { min-width: 100px; }
}

/* =====================================================
   FARBWÄHLER + GANZTÄGIG TOGGLE
   ===================================================== */
.fpc-color-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.fpc-color-swatch {
    width: 28px;
    height: 28px;
    min-width: 28px;  /* v2.3.3: erzwingt perfekten Kreis — kein Strecken */
    min-height: 28px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    touch-action: manipulation;
    flex-shrink: 0;
    padding: 0;        /* kein Browser-Button-Padding */
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.1s, border-color 0.1s;
    box-sizing: border-box;
}
.fpc-color-swatch:active { transform: scale(0.9); }
.fpc-color-swatch.is-active {
    border-color: var(--text) !important;
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text);
}

.fpc-form-field--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}
.fpc-toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.fpc-toggle input { opacity: 0; width: 0; height: 0; }
.fpc-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.2s;
}
.fpc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.fpc-toggle input:checked + .fpc-toggle-slider { background: var(--primary); }
.fpc-toggle input:checked + .fpc-toggle-slider::before { transform: translateX(18px); }

/* =====================================================
   QUICK GRID
   ===================================================== */
.fpc-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.fpc-quick-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    border: 1.5px solid transparent;
    font-family: inherit;
    text-align: left;
    min-height: 80px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.fpc-quick-card:active { box-shadow: var(--shadow-md); border-color: var(--border); }
.fpc-quick-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.fpc-quick-icon--primary { background: var(--primary-light); color: var(--primary); }
.fpc-quick-icon--success { background: var(--success-light); color: var(--success); }
.fpc-quick-icon--accent  { background: #fef9f0; color: var(--accent); }
.fpc-quick-icon--warning { background: var(--warning-light); color: var(--warning); }
.fpc-quick-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* =====================================================
   PENDING BANNER
   ===================================================== */
.fpc-pending-banner {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--warning);
    font-weight: 500;
}

/* =====================================================
   KANBAN
   ===================================================== */
.fpc-deals-kanban {
    display: flex;
    align-items: flex-start; /* v2.3.0: Spalten wachsen unabhängig */
    gap: 12px;
    /* v2.3.0: Horizontal scrollen via wrapper-trick — kein overflow-x+y Konflikt */
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    min-width: 0;
}
.fpc-kanban-col {
    flex-shrink: 0;
    width: 280px;     /* v2.3.0: 280px Tablet-Minimum */
    min-width: 280px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    scroll-snap-align: start;
    /* v2.3.0: Desktop — jede Spalte scrollt intern wenn sie zu lang wird */
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}
@media (min-width: 1024px) {
    .fpc-deals-kanban {
        /* Desktop: Kanban-Container wird nicht geclipt — Seite scrollt */
        overflow-y: visible;
        padding-bottom: 32px;
    }
    .fpc-kanban-col {
        width: 240px;
        min-width: 240px;
        max-height: calc(100vh - 180px);
    }
}
.fpc-kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fpc-kanban-col-title { font-size: 13px; font-weight: 700; color: var(--text); }
.fpc-kanban-col-sum { font-size: 12px; color: var(--text-muted); }
.fpc-kanban-deal {
    background: var(--card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    min-height: 52px;
    touch-action: manipulation;
}
.fpc-kanban-deal-title { font-size: 13px; font-weight: 600; color: var(--text); }
.fpc-kanban-deal-customer { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.fpc-kanban-deal-value { font-size: 13px; font-weight: 700; color: var(--primary); margin-top: 6px; }

/* =====================================================
   MODAL
   ===================================================== */
.fpc-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.fpc-modal[hidden] { display: none; }
.fpc-modal.is-open { animation: fpcModalIn 0.18s ease; }
@keyframes fpcModalIn { from { opacity: 0; } to { opacity: 1; } }

.fpc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.fpc-modal-panel {
    position: relative;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: fpcSlideUp 0.22s ease;
    overflow: hidden;
    /* Safe area am Boden */
    padding-bottom: var(--safe-bottom);
}
@keyframes fpcSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.fpc-modal-panel--lg { max-height: 96vh; }

@media (min-width: 640px) {
    .fpc-modal { align-items: center; padding: 24px; }
    .fpc-modal-panel { border-radius: var(--radius); max-width: 560px; max-height: 85vh; padding-bottom: 0; }
}

.fpc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.fpc-modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.fpc-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    touch-action: manipulation;
}
.fpc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.fpc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.fpc-modal-footer-right { display: flex; gap: 10px; margin-left: auto; }

/* =====================================================
   SIDE PANEL
   ===================================================== */
.fpc-side-panel {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: flex-end;
}
.fpc-side-panel[hidden] { display: none; }
.fpc-side-panel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.fpc-side-panel-inner {
    position: relative;
    background: var(--card);
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fpcSlideRight 0.22s ease;
    overflow: hidden;
}
@keyframes fpcSlideRight {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.fpc-side-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    /* Safe area oben (Notch) */
    padding-top: max(14px, env(safe-area-inset-top, 14px));
}
.fpc-side-panel-title { font-size: 17px; font-weight: 700; flex: 1; color: var(--text); }
.fpc-side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.fpc-back-btn,
.fpc-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    touch-action: manipulation;
}
.fpc-back-btn:active, .fpc-edit-btn:active { background: var(--bg); color: var(--primary); }

/* =====================================================
   v2.4.8.2: Doc-Panel Footer (sticky) + Header-Save-Button
   ===================================================== */
.fpc-side-panel-footer {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    /* Safe area unten (Home-Indicator) */
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}
.fpc-side-panel-footer .fpc-btn-secondary { flex: 0 0 auto; }
.fpc-side-panel-footer .fpc-btn-primary {
    flex: 1;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.fpc-side-panel-footer.fpc-doc-footer-readonly { display: none; } /* bei nicht-editierbaren Dokumenten ausblenden */

/* Header-Save-Button — kompakter als Footer */
#fpcDocSaveBtn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Mobile: Header-Button nur als Icon zeigen — Footer ist primary */
@media (max-width: 767px) {
    #fpcDocSaveBtn .fpc-doc-save-btn-label { display: none; }
    #fpcDocSaveBtn { padding: 6px 8px; min-height: 36px; }
}

/* =====================================================
   FORMS — KRITISCH für Mobile
   ===================================================== */
.fpc-form-field { margin-bottom: 16px; }
.fpc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.fpc-form-row--333 { grid-template-columns: 1fr 1.5fr 1fr; }
@media (max-width: 480px) {
    .fpc-form-row,
    .fpc-form-row--333 { grid-template-columns: 1fr; }
}

.fpc-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.fpc-form-hint { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.fpc-required { color: var(--danger); }

/* KRITISCH: font-size: 16px verhindert Zoom auf Android/iOS beim Tippen */
/* v2.0.6: color var(--text) dunkel statt text-muted (P3-Bug v2.0.4) */
.fpc-form-input,
.fpc-form-select,
.fpc-form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--text) !important;
    background: #fafbfc;
    transition: border-color 0.12s, box-shadow 0.12s;
    -webkit-appearance: none;
    min-height: 48px;
}
.fpc-form-input::placeholder { color: var(--text-muted); }
.fpc-form-input:-webkit-autofill,
.fpc-form-input:-webkit-autofill:hover,
.fpc-form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    box-shadow: 0 0 0 1000px #fafbfc inset !important;
}
.fpc-form-input:focus,
.fpc-form-select:focus,
.fpc-form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,138,138,0.10);
    background: #fff;
}
.fpc-form-textarea { resize: vertical; min-height: 88px; font-size: 16px; }
/* v2.19.0: .fpc-input-prefix-wrap / .fpc-input-prefix / .fpc-form-input--prefixed
   wurden entfernt — der einzige Verwendungsort (Deal-Modal Betrag-Feld) hat
   das Prefix-Pattern abgelegt, weil das CHF-Overlay den Eingabetext überdeckte
   (Specificity-Konflikt mit Theme/Browser-Defaults beim padding-left).
   Die Währung steht ohnehin im Currency-Select daneben, der Prefix war redundant. */

/* Autocomplete */
.fpc-autocomplete-wrap { position: relative; }
.fpc-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.fpc-autocomplete-item {
    padding: 14px 16px;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    min-height: 48px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
}
.fpc-autocomplete-item:last-child { border-bottom: none; }
.fpc-autocomplete-item:active { background: var(--primary-light); }

/* Header Dropdown */
.fpc-header-dropdown-wrap { position: relative; }
.fpc-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 50;
    min-width: 180px;
}
.fpc-dropdown-item {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    color: var(--text);
    min-height: 52px;
    touch-action: manipulation;
}
.fpc-dropdown-item:last-child { border-bottom: none; }
.fpc-dropdown-item:active { background: var(--primary-light); color: var(--primary); }

/* =====================================================
   APPROVAL WORKFLOW
   ===================================================== */
.fpc-approval-info { padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.fpc-workflow-steps { display: flex; align-items: center; }
.fpc-workflow-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.fpc-workflow-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--border); }
.fpc-workflow-step.is-done .fpc-workflow-dot   { background: var(--success); border-color: var(--success); }
.fpc-workflow-step.is-active .fpc-workflow-dot { background: var(--primary); border-color: var(--primary); }
.fpc-workflow-label { font-size: 10px; color: var(--text-muted); text-align: center; }
.fpc-workflow-line { flex: 1; height: 2px; background: var(--border); align-self: center; margin-bottom: 16px; }
.fpc-workflow-line.is-done { background: var(--success); }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.fpc-empty-state { text-align: center; padding: 48px 24px; }
.fpc-empty-icon { font-size: 48px; margin-bottom: 16px; }
.fpc-empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.fpc-empty-text { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }

/* =====================================================
   SKELETON LOADING
   ===================================================== */
@keyframes fpcSkeleton {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}
.fpc-skeleton { background: var(--border); border-radius: 4px; animation: fpcSkeleton 1.4s ease infinite; }
.fpc-skeleton--label    { height: 12px; width: 60%; margin-bottom: 8px; }
.fpc-skeleton--value    { height: 22px; width: 80%; }
.fpc-skeleton--title    { height: 16px; width: 70%; margin-bottom: 6px; }
.fpc-skeleton--line     { height: 13px; width: 50%; }
.fpc-skeleton--short    { height: 13px; width: 30%; margin-top: 8px; }
.fpc-skeleton--badge    { height: 24px; width: 70px; border-radius: 20px; }
.fpc-skeleton--time     { height: 13px; width: 44px; flex-shrink: 0; }
.fpc-skeleton--avatar-sm{ width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.fpc-skeleton-card      { box-shadow: none !important; border-left-color: var(--border) !important; }
.fpc-skeleton-content   { flex: 1; }
.fpc-skeleton-list      { display: flex; flex-direction: column; gap: 10px; }
.fpc-skeleton-row       { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border-radius: var(--radius-sm); }
.fpc-skeleton-cal       { background: var(--border); opacity: 0.4; animation: fpcSkeleton 1.4s ease infinite; }

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
#fpcToastContainer {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 360px;
}
.fpc-toast {
    background: #2c3e50;
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: fpcToastIn 0.2s ease;
    pointer-events: none;
    width: 100%;
    text-align: center;
}
.fpc-toast--success { background: var(--success); }
.fpc-toast--error   { background: var(--danger); }
.fpc-toast--info    { background: var(--primary); }
@keyframes fpcToastIn {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* =====================================================
   LOGIN PAGE — Mobile optimiert
   ===================================================== */
.fpc-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    background: #f4f6f8;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.fpc-login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    /* v2.18.0: 40 28 → 32 28 etwas kompakter */
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
}
/* v2.18.3: Logo-Header analog EPT — Logo, Firmenname (h1) und Subtitle
   leben jetzt im selben Wrapper-Block, mittig zentriert. Kein separates
   "Anmelden"-h1 mehr — Firmenname übernimmt diese Position. */
.fpc-login-logo {
    text-align: center;
    margin-bottom: 22px;
}
.fpc-login-logo-img {
    max-height: 60px;           /* EPT-konsistent (war 56px) */
    max-width: 220px;
    margin: 0 auto 12px auto;
    display: block;
    object-fit: contain;
}
/* Fallback wenn weder Logo noch Firmenname gesetzt (Firmenname-h1 nimmt sonst diese Stelle) */
.fpc-login-logo-text { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
/* Firmenname als h1 — übernimmt die Position des früheren "Anmelden"-Titels */
.fpc-login-company-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.fpc-login-subtitle {
    margin: 4px 0 0 0;
    font-size: 15px;
    color: #7f8c8d;
    line-height: 1.3;
}
.fpc-login-error {
    background: #fdf0ef;
    border: 1px solid #e74c3c40;
    border-left: 3px solid #e74c3c;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    color: #c0392b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fpc-field-group { margin-bottom: 16px; }
.fpc-field-label { display: block; font-size: 14px; font-weight: 600; color: #2c3e50; margin-bottom: 6px; }

/* v2.18.2: ARCHITEKTUR ANGEGLICHEN AN EPT
   ───────────────────────────────────────
   Mikas "Heimisch-Gefühl"-Prinzip: alle Module der Flow4u-Familie nutzen
   das gleiche Form-Pattern.
   - Keine Icons in den Feldern (User/Lock raus).
   - Border + Background direkt am Input (kein Wrap-Trick mehr).
   - Username-Feld braucht keinen Wrap.
   - Passwort-Feld hat Wrap nur als `position: relative` für das Auge-Toggle
     (analog EPT `.ept-password-wrapper`).
   - Schriftfarbe #2c3e50 (EPT-konsistent, dunkel/klar lesbar).
*/
.fpc-field-input,
input.fpc-field-input {  /* Doppel-Selector als Specificity-Boost gegen Theme */
    display: block;
    width: 100%;
    padding: 14px 14px;
    border: 1.5px solid #e8ecf0;
    border-radius: 10px;
    /* KRITISCH: 16px verhindert Auto-Zoom auf Android */
    font-size: 16px;
    font-family: inherit;
    color: #2c3e50;                /* EPT-konsistent */
    background: #fafbfc;
    min-height: 52px;
    box-sizing: border-box;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
    line-height: 1.4;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.fpc-field-input::placeholder,
input.fpc-field-input::placeholder { color: #bdc3c7; }
.fpc-field-input:focus,
input.fpc-field-input:focus {
    outline: none;
    border-color: #1a8a8a;
    box-shadow: 0 0 0 3px rgba(26,138,138,0.12);
    background: #fff;
}
/* Autofill-Override: Browser malt sonst gelb. Inset-Shadow matched #fafbfc,
   bei Focus wechselt auf #fff. */
.fpc-field-input:-webkit-autofill,
.fpc-field-input:-webkit-autofill:hover,
.fpc-field-input:-webkit-autofill:focus,
.fpc-field-input:-webkit-autofill:active {
    -webkit-text-fill-color: #2c3e50 !important;
    -webkit-box-shadow: 0 0 0 1000px #fafbfc inset !important;
    box-shadow: 0 0 0 1000px #fafbfc inset !important;
    transition: background-color 9999s ease-in-out 0s;
}
.fpc-field-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(26,138,138,0.12) !important;
    box-shadow:         0 0 0 1000px #fff inset, 0 0 0 3px rgba(26,138,138,0.12) !important;
}

/* Wrap existiert nur noch beim Passwort-Feld als Container fürs Auge-Toggle. */
.fpc-field-wrap {
    position: relative;
}
.fpc-field-wrap .fpc-field-input {
    padding-right: 52px; /* Platz für Toggle-Button rechts */
}

/* Auge-Toggle rechts vom Input (analog EPT). Defensives CSS gegen Theme-Hover. */
.fpc-field-wrap .fpc-field-toggle,
.fpc-field-wrap button.fpc-field-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0 8px 8px 0;
    touch-action: manipulation;
    transition: color 0.12s, background 0.12s;
}
.fpc-field-wrap .fpc-field-toggle:hover,
.fpc-field-wrap .fpc-field-toggle:focus-visible,
.fpc-field-wrap button.fpc-field-toggle:hover {
    background: rgba(26,138,138,0.08) !important;
    color: #1a8a8a;
}
.fpc-field-wrap .fpc-field-toggle:focus-visible {
    outline: 2px solid #1a8a8a;
    outline-offset: -3px;
}
.fpc-field-toggle svg { display: block; pointer-events: none; }

.fpc-login-remember { margin-bottom: 20px; }
.fpc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #7f8c8d;
    cursor: pointer;
    min-height: 44px;
    touch-action: manipulation;
}
.fpc-checkbox-label input[type="checkbox"] { display: none; }
.fpc-checkbox-custom {
    width: 22px;
    height: 22px;
    border: 1.5px solid #e8ecf0;
    border-radius: 5px;
    background: #fafbfc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s;
}
.fpc-checkbox-label input:checked + .fpc-checkbox-custom { background: #1a8a8a; border-color: #1a8a8a; }
.fpc-checkbox-label input:checked + .fpc-checkbox-custom::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 700; }
.fpc-btn-login {
    width: 100%;
    padding: 16px;
    background: #1a8a8a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
}
.fpc-btn-login:active { background: #14706e; }
.fpc-btn-login:disabled { opacity: 0.6; cursor: not-allowed; }
.fpc-login-footer { margin-top: 24px; text-align: center; font-size: 13px; color: #bdc3c7; }
@media (max-width: 400px) { .fpc-login-card { padding: 28px 18px; } }

/* =====================================================
   UTILITY
   ===================================================== */
.fpc-text-muted    { color: var(--text-muted); }
.fpc-text-primary  { color: var(--primary); }
.fpc-text-success  { color: var(--success); }
.fpc-text-danger   { color: var(--danger); }
.fpc-mt-8  { margin-top: 8px; }
.fpc-mt-12 { margin-top: 12px; }
.fpc-mb-0  { margin-bottom: 0; }

.fpc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.fpc-detail-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.fpc-detail-value { font-size: 15px; color: var(--text); font-weight: 500; }
.fpc-detail-value a { color: var(--primary); text-decoration: none; }

/* Telefon/Mail-Links im Detail gross genug zum Tippen */
.fpc-detail-value a[href^="tel"],
.fpc-detail-value a[href^="mailto"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 6px;
}

.fpc-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* =====================================================
   DASHBOARD — PORTAL HEADER (v2.0.2)
   ===================================================== */
.fpc-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 50; /* v2.2.5: erhöht, damit kein Theme-Element darüber liegt */
    isolation: isolate; /* v2.2.5: eigener Stacking Context */
}
.fpc-greeting-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.fpc-greeting-date {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 3px;
}
@media (min-width: 768px) {
    .fpc-greeting-title { font-size: 24px; }
}
.fpc-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fpc-user-text { text-align: right; }
.fpc-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.fpc-user-role { font-size: 12px; color: var(--text-muted); }
@media (max-width: 479px) {
    .fpc-user-text { display: none; }
}

/* =====================================================
   KPI CARDS — MOCKUP-STYLE (v2.0.2)
   ===================================================== */
.fpc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .fpc-kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.fpc-kpi-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 90px;
}
.fpc-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.fpc-kpi-card--target::before  { background: var(--primary); }
.fpc-kpi-card--won::before     { background: var(--success); }
.fpc-kpi-card--deals::before   { background: var(--accent); }
.fpc-kpi-card--pipeline::before{ background: var(--warning); }
.fpc-kpi-card:active { transform: scale(0.98); }
.fpc-kpi-icon { font-size: 22px; margin-bottom: 6px; }
.fpc-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
@media (min-width: 768px) { .fpc-kpi-value { font-size: 26px; } }
@media (max-width: 479px) { .fpc-kpi-value { font-size: 18px; } .fpc-kpi-card { padding: 12px; } }
.fpc-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 5px;
}
.fpc-kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.fpc-kpi-progress { margin-top: 8px; background: #ecf0f1; border-radius: 10px; height: 5px; overflow: hidden; }
.fpc-kpi-progress-bar { height: 100%; background: var(--primary); border-radius: 10px; transition: width 0.5s ease; }

/* =====================================================
   TAGES-KALENDER / TIMELINE (v2.0.2)
   ===================================================== */
.fpc-cal-section {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.fpc-cal-section-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.fpc-cal-section-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fpc-cal-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    min-height: 36px;
    min-width: 36px;
    touch-action: manipulation;
}
.fpc-cal-btn:active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.fpc-cal-btn--today { font-weight: 600; }
.fpc-cal-section-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    gap: 6px;
    align-items: center;
}
.fpc-cal-weekday { color: var(--text-muted); font-weight: 400; }

.fpc-timeline-day {
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.fpc-timeslot {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    border-bottom: 1px solid var(--border);
}
.fpc-timeslot:last-child { border-bottom: none; }
.fpc-timeslot-label {
    width: 52px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 8px 0;
    text-align: right;
    border-right: 1px solid var(--border);
}
.fpc-timeslot-content {
    flex: 1;
    padding: 6px 10px;
    display: flex;
    align-items: center;
}
.fpc-timeslot-add {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    min-height: 36px;
    touch-action: manipulation;
    opacity: 0;
    transition: opacity 0.1s;
}
.fpc-timeslot:hover .fpc-timeslot-add,
.fpc-timeslot-add:focus { opacity: 1; }
/* Auf Touch-Geräten immer sichtbar */
@media (hover: none) { .fpc-timeslot-add { opacity: 0.7; } }

/* Event-Karte im Timeline */
.fpc-event-card {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    flex: 1;
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 40px;
    position: relative;
    z-index: 2;
}
.fpc-event-card--meeting  { background: #e8f4fd; border-left: 3px solid #3498db; }
.fpc-event-card--call     { background: #fef9f0; border-left: 3px solid var(--accent); }
.fpc-event-card--task     { background: var(--success-light); border-left: 3px solid var(--success); }
.fpc-event-card--demo     { background: #f5eef8; border-left: 3px solid #9b59b6; }
.fpc-event-card--followup { background: var(--warning-light); border-left: 3px solid var(--warning); }
.fpc-event-card--other    { background: var(--bg); border-left: 3px solid var(--text-muted); }
.fpc-event-card-body { flex: 1; min-width: 0; }
.fpc-event-time { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.fpc-event-title { font-size: 13px; font-weight: 600; color: var(--text); }
.fpc-event-customer { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpc-event-duration { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.fpc-event-edit {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    touch-action: manipulation;
    flex-shrink: 0;
}
@media (hover: none) { .fpc-event-edit { opacity: 1; } }

/* v2.0.9: Belegte Timeslots (durch mehrstündige Events) */
.fpc-timeslot--occupied {
    min-height: 52px;
    border-bottom: 1px solid var(--border);
}
.fpc-timeslot--occupied .fpc-timeslot-content {
    background: repeating-linear-gradient(
        -45deg, transparent, transparent 4px,
        rgba(26,138,138,0.04) 4px, rgba(26,138,138,0.04) 8px
    );
}
/* Timeslot overflow erlauben für mehrstündige Event-Cards */
.fpc-timeslot { overflow: visible; }
.fpc-timeslot-content { overflow: visible; }

/* =====================================================
   PIPELINE DEALS SECTION (v2.0.2)
   ===================================================== */
.fpc-deals-section { margin-bottom: 20px; }
.fpc-deals-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.fpc-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.fpc-dash-filter-chips { margin-bottom: 0; }

/* Mobile Karten */
.fpc-deals-cards { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 768px) { .fpc-deals-cards { display: none; } }

/* Desktop Tabelle */
.fpc-deals-table-wrap { display: none; overflow-x: auto; }
@media (min-width: 768px) { .fpc-deals-table-wrap { display: block; } }
.fpc-deals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.fpc-deals-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.fpc-deals-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
.fpc-deals-table tr:last-child td { border-bottom: none; }
.fpc-deals-table tr:hover td { background: var(--bg); }
.fpc-deals-table .fpc-btn-edit {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    min-height: 32px;
    touch-action: manipulation;
}
.fpc-deals-table .fpc-btn-edit:hover { border-color: var(--primary); color: var(--primary); }

/* =====================================================
   ACTION GRID / SCHNELLZUGRIFF (v2.0.2)
   ===================================================== */
/* v2.0.7: Schnellzugriff — Horizontale Buttons (44px) über KPI-Karten */
.fpc-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
@media (min-width: 640px) {
    .fpc-quick-actions { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
.fpc-quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.12s, border-color 0.12s, transform 0.1s;
    padding: 0 12px;
    white-space: nowrap;
}
.fpc-quick-btn:active { transform: scale(0.97); }
.fpc-quick-btn--customer { border-left: 3px solid var(--primary); }
.fpc-quick-btn--deal     { border-left: 3px solid var(--success); }
.fpc-quick-btn--document { border-left: 3px solid var(--accent); }
.fpc-quick-btn--event    { border-left: 3px solid var(--warning); }
.fpc-quick-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }

/* Dokument-Dropdown im Schnellzugriff */
.fpc-doc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    overflow: hidden;
}
.fpc-doc-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    min-height: 44px;
    touch-action: manipulation;
}
.fpc-doc-option:last-child { border-bottom: none; }
.fpc-doc-option:active { background: var(--primary-light); color: var(--primary); }

/* v2.2.7: Emoji-Spans in Buttons dürfen keine Pointer-Events empfangen */
.fpc-quick-icon,
.fpc-btn-primary span,
.fpc-btn-secondary span,
.fpc-btn-danger span { pointer-events: none; }

/* =====================================================
   v2.4.0: DEAL-ITEMS (Produkte zu Deals)
   ===================================================== */

/* Hint am Wert-Feld wenn aus Items berechnet */
.fpc-deal-value-hint {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(26, 138, 138, 0.10);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Readonly-Wert-Feld */
.fpc-form-input--readonly {
    background: #eef2f5 !important;
    color: var(--text) !important;
    cursor: not-allowed;
}

/* Form-Section Header */
.fpc-form-section {
    margin-top: 20px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1.5px solid var(--border);
}
.fpc-form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.fpc-form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.fpc-form-section-hint {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Form-Row Varianten */
.fpc-form-row--3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.fpc-form-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 480px) {
    .fpc-form-row--3col { grid-template-columns: 1fr 1fr; }
    .fpc-form-row--2col { grid-template-columns: 1fr 1fr; }
}

/* Items-Liste */
.fpc-deal-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Einzelnes Item */
.fpc-deal-item {
    background: #fafbfc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    position: relative;
}
.fpc-deal-item .fpc-form-field { margin-bottom: 10px; }
.fpc-deal-item .fpc-form-row,
.fpc-deal-item .fpc-form-row--2col,
.fpc-deal-item .fpc-form-row--3col { margin-bottom: 10px; }
.fpc-deal-item-desc {
    min-height: 60px !important;
    font-size: 14px;
    line-height: 1.4;
}

.fpc-deal-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.fpc-deal-item-pos {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.fpc-deal-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.10);
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: background 0.12s;
}
.fpc-deal-item-remove:hover,
.fpc-deal-item-remove:active {
    background: var(--danger);
    color: #fff;
}

/* Position-Total am Ende eines Items */
.fpc-deal-item-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.fpc-deal-item-total-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fpc-deal-item-total-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fpc-deal-item-total-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.fpc-deal-item-total-tax {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.fpc-deal-item-total-tax-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
}
.fpc-deal-item-total-tax-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Empty-State */
.fpc-deal-items-empty {
    background: #fafbfc;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}
.fpc-deal-items-empty-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Summary-Block */
.fpc-deal-items-summary {
    margin-top: 14px;
    padding: 14px;
    background: rgba(26, 138, 138, 0.05);
    border: 1.5px solid rgba(26, 138, 138, 0.20);
    border-radius: var(--radius-sm);
}
.fpc-deal-items-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
.fpc-deal-items-summary-label {
    color: var(--text-muted);
    font-weight: 500;
}
.fpc-deal-items-summary-value {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.fpc-deal-items-summary-row--total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1.5px solid rgba(26, 138, 138, 0.30);
}
.fpc-deal-items-summary-row--total .fpc-deal-items-summary-label {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}
.fpc-deal-items-summary-row--total .fpc-deal-items-summary-value {
    color: var(--primary);
    font-weight: 800;
    font-size: 17px;
}
.fpc-deal-items-summary-row--info {
    margin-top: 4px;
    padding-top: 4px;
}
.fpc-deal-items-summary-row--info .fpc-deal-items-summary-label {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}
.fpc-deal-items-summary-row--info .fpc-deal-items-summary-value {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

/* =====================================================
   v2.4.6: Kanban Drag & Drop (Mouse + Touch)
   ===================================================== */

/* Cards: cursor + Touch-Eigenschaften */
.fpc-kanban-deal {
    cursor: grab;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(26, 138, 138, 0.10);
    -webkit-touch-callout: none;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.fpc-kanban-deal:active {
    cursor: grabbing;
}

/* Mouse-Drag aktiv */
.fpc-kanban-deal--dragging {
    opacity: 0.4;
    transform: rotate(2deg);
}

/* Drop-Zone Highlight */
.fpc-kanban-col--drag-over {
    background: rgba(26, 138, 138, 0.12);
    outline: 2px dashed var(--primary);
    outline-offset: -4px;
}

/* Empty Column → "Hier ablegen" Hinweis */
.fpc-kanban-col-empty {
    padding: 20px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    background: rgba(0,0,0,0.02);
    font-style: italic;
}

/* Touch-Klon (Card folgt Finger) */
.fpc-kanban-touch-clone {
    pointer-events: none !important;
    will-change: transform;
    transition: none !important;
}

/* Drop-Zone bekommt auf Touch noch deutlicheres Feedback */
@media (hover: none) and (pointer: coarse) {
    .fpc-kanban-col--drag-over {
        background: rgba(26, 138, 138, 0.18);
    }
}

/* Touch-Hint für Kanban (nur auf Touch-Geräten sichtbar) */
.fpc-kanban-mobile-hint {
    display: none;
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 4px solid #f5a623;
    border-radius: 6px;
    color: #5a4a00;
    font-size: 13px;
    line-height: 1.45;
}
.fpc-kanban-mobile-hint strong { color: #1a8a8a; }

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .fpc-kanban-mobile-hint:not([hidden]) { display: block; }
}

/* =====================================================
   v2.4.7: DOKUMENTE — Submenu + Edit-Panel + Items
   ===================================================== */

/* Gruppiertes Dropdown-Menu */
.fpc-dropdown-menu--grouped {
    min-width: 280px;
    max-width: 92vw;
    padding: 6px 0;
}
.fpc-dropdown-section {
    padding: 4px 0;
}
.fpc-dropdown-section + .fpc-dropdown-section {
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
    padding-top: 8px;
}
.fpc-dropdown-section-title {
    padding: 6px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.fpc-dropdown-icon {
    display: inline-block;
    width: 22px;
    text-align: center;
    margin-right: 6px;
}
.fpc-dropdown-menu--grouped .fpc-dropdown-item {
    padding-left: 16px;
}

/* Filter-Chips Divider */
.fpc-chip-divider {
    width: 1px;
    align-self: stretch;
    background: #cbd5e1;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Card: Konvertiert (graue Tönung) */
.fpc-document-card--converted {
    opacity: 0.72;
}
.fpc-document-card--converted .fpc-document-number::after {
    content: ' 🔁';
    opacity: 0.6;
}

/* =====================================================
   Side-Panel: Document-Edit
   ===================================================== */
.fpc-side-panel--doc .fpc-side-panel-inner {
    /* v2.4.7.2 (1c): Mobil = echte 100% Breite (überschreibt 480px-Default) */
    max-width: 100%;
}

/* Save-Indicator */
.fpc-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    transition: opacity 0.15s ease;
}
.fpc-save-indicator[hidden] { display: none; }
.fpc-save-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}
.fpc-save-indicator.is-saving { background: #fef3c7; color: #92400e; }
.fpc-save-indicator.is-saving .fpc-save-indicator-dot {
    background: #f59e0b;
    animation: fpc-pulse-dot 1s ease-in-out infinite;
}
.fpc-save-indicator.is-saved { background: #d1fae5; color: #065f46; }
.fpc-save-indicator.is-saved .fpc-save-indicator-dot { background: #10b981; }
.fpc-save-indicator.is-error { background: #fee2e2; color: #991b1b; }
.fpc-save-indicator.is-error .fpc-save-indicator-dot { background: #ef4444; }

@keyframes fpc-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.8); }
}

/* Status-Banner (nicht editierbar) */
.fpc-doc-status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 0 0 16px;
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
    border-radius: 6px;
    font-size: 14px;
    color: #475569;
}
.fpc-doc-status-banner--converted {
    background: #f0fdf4;
    border-left-color: #22c55e;
    color: #166534;
}

/* Parent-Banner (Konvertierung-Verlinkung) */
.fpc-doc-parent-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 0 0 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 14px;
    color: #1e40af;
}
.fpc-doc-parent-icon { font-size: 16px; }

/* =====================================================
   Doc-Section (Block-Container im Edit-Panel)
   ===================================================== */
.fpc-doc-section {
    margin: 0 0 20px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.fpc-doc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a8a8a;
}
.fpc-doc-section-hint {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

/* =====================================================
   Kunde-Block
   ===================================================== */
.fpc-doc-customer-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.fpc-doc-customer-info { flex: 1; min-width: 0; }
.fpc-doc-customer-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 2px;
}
.fpc-doc-customer-addr {
    font-size: 13px;
    color: #64748b;
}
.fpc-doc-customer-change {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.15s;
}
.fpc-doc-customer-change:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.fpc-doc-customer-empty {
    position: relative;
}

/* v2.4.7.2: Combobox — Input + Caret-Toggle für Klick-Dropdown */
.fpc-doc-customer-input-wrap {
    position: relative;
}
.fpc-doc-customer-input.fpc-form-input {
    padding-right: 38px; /* Platz für Caret */
}
.fpc-doc-customer-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, transform 0.18s;
    touch-action: manipulation;
}
.fpc-doc-customer-toggle:hover { background: #f1f5f9; color: #1a8a8a; }
.fpc-doc-customer-toggle:active { background: #e2e8f0; }
.fpc-doc-customer-empty.is-open .fpc-doc-customer-toggle { transform: translateY(-50%) rotate(180deg); color: #1a8a8a; }
.fpc-doc-customer-empty.is-open .fpc-doc-customer-input { border-color: #1a8a8a; }

.fpc-doc-customer-result-loading {
    padding: 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
.fpc-doc-customer-results {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-y: auto;          /* v2.4.7.2: scrollbar bei 10+ */
    max-height: 320px;         /* v2.4.7.2: max-Höhe */
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.fpc-doc-customer-results[hidden] { display: none; }
.fpc-doc-customer-result {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
}
.fpc-doc-customer-result:last-child { border-bottom: 0; }
.fpc-doc-customer-result:hover,
.fpc-doc-customer-result:active {
    background: #f8fafc;
}
.fpc-doc-customer-result-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}
.fpc-doc-customer-result-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}
.fpc-doc-customer-result-empty {
    padding: 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* =====================================================
   Items
   ===================================================== */
.fpc-doc-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fpc-doc-items-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}
.fpc-doc-items-empty[hidden] { display: none; }

.fpc-doc-items-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.fpc-doc-items-actions .fpc-btn-secondary {
    flex: 1 1 140px;
    min-height: 44px;
}

/* Einzelnes Item */
.fpc-doc-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    transition: opacity 0.15s, transform 0.15s, border-color 0.15s;
}
.fpc-doc-item--text {
    background: #fffbeb;
    border-color: #fde68a;
}
.fpc-doc-item--dragging {
    opacity: 0.45;
    transform: scale(0.98);
}
.fpc-doc-item--drop-before {
    border-top: 3px solid #1a8a8a;
    margin-top: -2px;
}

.fpc-doc-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.fpc-doc-item-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 18px;
    font-weight: 700;
    user-select: none;
    touch-action: none;
    padding: 0 4px;
    line-height: 1;
}
.fpc-doc-item-handle:active { cursor: grabbing; }
.fpc-doc-item-pos {
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
    min-width: 22px;
}
.fpc-doc-item-mode {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    flex: 1;
}
.fpc-doc-item-remove {
    background: transparent;
    border: 0;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}
.fpc-doc-item-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.fpc-doc-item-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fpc-doc-item-total-main,
.fpc-doc-item-total-tax {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.fpc-doc-item-total-main {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}
.fpc-doc-item-total-tax {
    color: #94a3b8;
    font-size: 12px;
}

/* =====================================================
   Summary
   ===================================================== */
.fpc-doc-summary {
    margin: 24px 0 0;
    padding: 16px;
    background: linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
    border: 1px solid #99f6e4;
    border-radius: 10px;
}
.fpc-doc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #2c3e50;
}
.fpc-doc-summary-row[hidden] { display: none; }
.fpc-doc-summary-row--muted {
    color: #64748b;
    font-size: 12px;
}
.fpc-doc-summary-row--total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid #14b8a6;
    font-weight: 700;
    font-size: 18px;
    color: #0f766e;
}

/* =====================================================
   Aktions-Buttons unter dem Edit-Panel
   ===================================================== */
.fpc-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 8px;
}
.fpc-doc-actions .fpc-btn-primary,
.fpc-doc-actions .fpc-btn-secondary {
    flex: 1 1 160px;
    min-height: 44px;
}

/* Danger-Variante */
.fpc-btn-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}
.fpc-btn-danger:hover,
.fpc-btn-danger:active {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

/* =====================================================
   Source-Picker / Product-Picker (Modals)
   ===================================================== */
.fpc-modal-inner--md {
    max-width: 560px;
    width: 92vw;
}

.fpc-search-input-wrap {
    margin: 0 0 12px;
}
.fpc-search-input-wrap .fpc-form-input {
    font-size: 16px;
}

.fpc-source-picker-list,
.fpc-product-picker-list {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}
.fpc-source-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
    min-height: 60px;
}
.fpc-source-picker-item:last-child { border-bottom: 0; }
.fpc-source-picker-item:hover,
.fpc-source-picker-item:active {
    background: #f8fafc;
}
.fpc-source-picker-main {
    flex: 1;
    min-width: 0;
}
.fpc-source-picker-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 2px;
}
.fpc-source-picker-sub {
    font-size: 13px;
    color: #64748b;
}
.fpc-source-picker-amount {
    flex-shrink: 0;
    font-weight: 700;
    color: #0f766e;
    font-size: 15px;
}

/* Empty-Mini (in Pickers) */
.fpc-empty-mini {
    padding: 20px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* =====================================================
   Pending-Banner (im Listen-Screen)
   ===================================================== */
.fpc-pending-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 0 0 12px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    font-size: 14px;
    color: #78350f;
}
.fpc-pending-banner[hidden] { display: none; }
.fpc-pending-icon { font-size: 18px; }
.fpc-pending-text strong { font-weight: 700; }

/* =====================================================
   Mobile-First: ≥16px Input-Schrift, Touch-Targets ≥44px
   ===================================================== */
.fpc-doc-section .fpc-form-input,
.fpc-doc-section .fpc-form-select,
.fpc-doc-section .fpc-form-textarea {
    font-size: 16px;
    color: #2c3e50;
    background: #ffffff;
}
.fpc-doc-section .fpc-form-input:focus,
.fpc-doc-section .fpc-form-select:focus,
.fpc-doc-section .fpc-form-textarea:focus {
    color: #2c3e50;
}
.fpc-doc-section .fpc-form-input:-webkit-autofill,
.fpc-doc-section .fpc-form-input:-webkit-autofill:hover,
.fpc-doc-section .fpc-form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #2c3e50;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
}

/* Tablet/Desktop: Side-Panel breiter — v2.4.7.2: nur Maus-Desktop, Touch-Tablets bleiben 100% */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .fpc-side-panel--doc .fpc-side-panel-inner {
        max-width: 720px;
    }
}

/* =====================================================
   v2.4.7.1: Modal-Picker-Variante (Source/Product) + Handle-UX-Fix
   ===================================================== */

/* Modal-Picker: nutzt fpc-modal-panel als Basis, erweitert max-width */
.fpc-modal-panel--picker {
    max-width: 560px;
}
@media (min-width: 640px) {
    .fpc-modal-panel--picker {
        max-width: 560px;
        max-height: 80vh;
    }
}

/* Drag-Handle: als greifbares Knopf-artiges Element gestalten */
.fpc-doc-item-handle[draggable="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: grab;
    font-weight: 700;
    font-size: 14px;
    user-select: none;
    -webkit-user-drag: element;
    touch-action: none;
    transition: background 0.12s, border-color 0.12s;
    flex-shrink: 0;
}
.fpc-doc-item-handle[draggable="true"]:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.fpc-doc-item-handle[draggable="true"]:active {
    cursor: grabbing;
    background: #cbd5e1;
}

/* =====================================================
   v2.4.8.3: Dokument-Vorschau (Iframe-Render im Druck-Layout)
   ===================================================== */
.fpc-side-panel--preview .fpc-side-panel-inner--preview {
    /* Mobile: 100% wie auch beim Doc-Edit-Panel (v2.4.7.2-Konvention) */
    max-width: 100%;
    background: #e2e8f0; /* leichter Grau-Hintergrund — A4-Page hebt sich besser ab */
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .fpc-side-panel--preview .fpc-side-panel-inner--preview {
        max-width: 880px; /* etwas breiter als Doc-Edit (720px) — A4 + Padding */
    }
}
.fpc-doc-preview-body {
    padding: 0 !important;
    background: #e2e8f0;
    overflow: hidden; /* Iframe scrollt selbst */
}
.fpc-doc-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    display: block;
}
/* Mobile: Print-Label nur als Icon */
@media (max-width: 767px) {
    #fpcDocPreviewPrintBtn .fpc-doc-preview-print-label { display: none; }
    #fpcDocPreviewPrintBtn { padding: 6px 10px; min-height: 36px; }
}
