/**
 * Engineering Fee — Payment Schedule (Zahlungsplan) + Fee module cards.
 *
 * Companion stylesheet for assets/js/ee-payment-schedule.js and the
 * "Intern" pane markup in src/Shortcodes/ProjectShortcode.php.
 * Visual reference: /tmp/provision-mockup.html (Konzept Rev. 2.2, Kap. 7).
 *
 * Colors: Kunde = green (#30d158), EPC = purple (#a78bfa),
 * due = amber (#ff9f0a), invoiced = blue (#64d2ff), error = red (#ff453a).
 */

/* ============================================================
   Fee module cards (Intern pane, two pots)
   ============================================================ */
.ee-fee-rate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
}
@media (max-width: 900px) {
    .ee-fee-rate-grid { grid-template-columns: 1fr; }
}
.ee-fee-rate-card {
    background: var(--fbv2-bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
    border-radius: 14px;
    padding: 18px 20px;
    transition: opacity 0.2s;
}
.ee-fee-rate-card--kunde { border-top: 3px solid var(--fbv2-accent, #30d158); }
.ee-fee-rate-card--epc { border-top: 3px solid var(--fbv2-purple, #a78bfa); }
.ee-fee-rate-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.ee-fee-rate-card-head h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 2px;
}
.ee-fee-rate-card--kunde .ee-fee-rate-card-head h4 { color: var(--fbv2-accent, #30d158); }
.ee-fee-rate-card--epc .ee-fee-rate-card-head h4 { color: var(--fbv2-purple, #a78bfa); }
.ee-fee-rate-card-head p {
    font-size: 11px;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    margin: 0;
}
.ee-fee-module-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}
/* Toggle switch (mockup .toggle): hidden checkbox + track/knob span */
.ee-fee-module-check input[type="checkbox"] {
    display: none !important;
}
.ee-fee-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 0.15s;
    flex-shrink: 0;
    vertical-align: middle;
}
.ee-fee-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.ee-fee-module-check input[type="checkbox"]:checked + .ee-fee-switch {
    background: var(--fbv2-accent, #30d158);
}
.ee-fee-rate-card--epc .ee-fee-module-check input[type="checkbox"]:checked + .ee-fee-switch {
    background: var(--fbv2-purple, #a78bfa);
}
.ee-fee-module-check input[type="checkbox"]:checked + .ee-fee-switch::after {
    left: 21px;
}
.ee-fee-module-check span.ee-fee-switch-txt,
.ee-fee-module-check span:not(.ee-fee-switch) {
    font-size: 11px;
    font-weight: 600;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    line-height: 1;
}
.ee-fee-off-note {
    display: none;
    margin-top: 10px;
    font-size: 12px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--fbv2-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 9px;
    padding: 8px 12px;
}
.ee-fee-rate-card.ee-fee-module-off { border-top-color: var(--fbv2-border-strong, rgba(255, 255, 255, 0.18)); }
.ee-fee-rate-card.ee-fee-module-off .ee-fee-off-note { display: block; }

/* ============================================================
   Fee header (Geschäftsmodell / Privilegiert / Eigentumsanteil)
   Self-contained grid so page/theme CSS cannot distort it.
   ============================================================ */
.ee-form-row.ee-fee-head-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
    align-items: start;
    margin: 0 0 14px;
}
@media (max-width: 900px) {
    .ee-form-row.ee-fee-head-row { grid-template-columns: 1fr; }
}
.ee-fee-head-row .ee-form-group { margin: 0; }
.ee-fee-head-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.ee-fee-head-row select,
.ee-fee-head-row input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid var(--fbv2-border-strong, rgba(255, 255, 255, 0.16)) !important;
    border-radius: 9px !important;
    color: var(--fbv2-text, #e8e8ed) !important;
    font-size: 13px;
    padding: 8px 11px;
    box-shadow: none !important;
}
.ee-fee-head-row p.ee-form-hint,
.ee-fee-head-row div.ee-form-hint,
.ee-fee-head-row small {
    display: block;
    font-size: 11px;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    margin: 5px 0 0;
    line-height: 1.45;
}
.ee-fee-head-row label .ee-form-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    text-transform: none;
}

/* Model pill group (mockup .pill-group / .pill) */
.ee-fee-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ee-fee-pill,
button.ee-fee-pill {
    border: 1px solid var(--fbv2-border-strong, rgba(255, 255, 255, 0.16)) !important;
    border-radius: 999px !important;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6)) !important;
    cursor: pointer;
    background: transparent !important;
    font-family: inherit;
    box-shadow: none !important;
    line-height: 1.2;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ee-fee-pill:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: var(--fbv2-text, #e8e8ed) !important;
}
.ee-fee-pill.active,
button.ee-fee-pill.active {
    background: rgba(48, 209, 88, 0.14) !important;
    border-color: var(--fbv2-accent, #30d158) !important;
    color: var(--fbv2-accent, #30d158) !important;
}
/* Privileged toggle row (mockup .toggle-row + .auto-badge) */
.ee-fee-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 34px;
}
/* The module-check label inside the head row must stay inline-flex
   (the generic .ee-fee-head-row label rule sets display:block). */
.ee-fee-head-row label.ee-fee-module-check {
    display: inline-flex;
    margin: 0;
}
.ee-fee-priv-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fbv2-text, #e8e8ed);
    white-space: nowrap;
}
.ee-fee-auto-badge,
button.ee-fee-auto-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fbv2-accent, #30d158) !important;
    background: rgba(48, 209, 88, 0.1) !important;
    border: 1px solid rgba(48, 209, 88, 0.3) !important;
    border-radius: 6px !important;
    padding: 2px 7px;
    cursor: default;
    box-shadow: none !important;
    font-family: inherit;
    line-height: 1.4;
}
.ee-fee-auto-badge.ee-fee-badge-override,
button.ee-fee-auto-badge.ee-fee-badge-override {
    color: var(--fbv2-amber, #ff9f0a) !important;
    background: rgba(255, 159, 10, 0.1) !important;
    border-color: rgba(255, 159, 10, 0.35) !important;
    cursor: pointer;
}
/* Context chips (mockup .chips / .chip) */
.ee-fee-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}
.ee-fee-chip {
    font-size: 12px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 5px 10px;
    white-space: nowrap;
}
.ee-fee-chip b {
    color: var(--fbv2-text, #e8e8ed);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* ============================================================
   Milestone editor + flat-tier tables (mockup .ms-table /
   .tier-table). Hard resets with !important to neutralize
   theme table/input borders ("weiße Linien").
   ============================================================ */
.ee-ms-table,
.ee-flat-tiers-table {
    width: 100%;
    border-collapse: collapse !important;
    border: none !important;
    background: transparent !important;
    font-size: 12.5px;
    box-shadow: none !important;
}
.ee-ms-table th,
.ee-flat-tiers-table th {
    border: none !important;
    background: transparent !important;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    padding: 4px 6px;
}
.ee-ms-table td,
.ee-flat-tiers-table td {
    border: none !important;
    border-top: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.08)) !important;
    background: transparent !important;
    padding: 4px 6px;
    vertical-align: middle;
    color: var(--fbv2-text, #e8e8ed);
}
.ee-ms-table input,
.ee-ms-table select,
.ee-flat-tiers-table input,
.ee-flat-tiers-table select {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.08)) !important;
    border-radius: 7px !important;
    color: var(--fbv2-text, #e8e8ed) !important;
    font-size: 12.5px;
    padding: 5px 8px !important;
    box-shadow: none !important;
    outline: none;
    margin: 0;
}
.ee-ms-table input:focus,
.ee-flat-tiers-table input:focus {
    border-color: var(--fbv2-border-strong, rgba(255, 255, 255, 0.16)) !important;
}
/* Remove-row (✕) buttons inside editor tables */
.ee-ms-table td button,
.ee-flat-tiers-table td button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    line-height: 1;
}
.ee-ms-table td button:hover,
.ee-flat-tiers-table td button:hover {
    color: var(--fbv2-red, #ff453a);
}
/* Outline buttons ("+ Meilenstein / + Stufe hinzufügen") */
.ee-fee-rate-card .btn-outline,
.ee-fee-rate-card button.btn-outline {
    background: transparent !important;
    border: 1px solid var(--fbv2-border-strong, rgba(255, 255, 255, 0.16)) !important;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6)) !important;
    border-radius: 8px !important;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    box-shadow: none !important;
    margin-top: 10px;
}
.ee-fee-rate-card .btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: var(--fbv2-text, #e8e8ed) !important;
}

/* Milestone editor sum indicator (project + settings page) */
.ms-sum-ok,
.ms-sum-err {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}
.ms-sum-ok {
    background: rgba(48, 209, 88, 0.08);
    border: 1px solid rgba(48, 209, 88, 0.3);
    color: var(--fbv2-accent, #30d158);
}
.ms-sum-err {
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.4);
    color: var(--fbv2-red, #ff453a);
}

/* ============================================================
   Sync badge + empty state
   ============================================================ */
.ee-ps-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fbv2-blue, #64d2ff);
    background: rgba(100, 210, 255, 0.08);
    border: 1px solid rgba(100, 210, 255, 0.3);
    border-radius: 999px;
    padding: 3px 10px;
    vertical-align: middle;
}
.ee-ps-dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fbv2-blue, #64d2ff);
    animation: ee-ps-pulse 2s infinite;
}
@keyframes ee-ps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.ee-ps-empty {
    border: 1px dashed var(--fbv2-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 12px;
    padding: 22px 18px;
    text-align: center;
    font-size: 13px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
}

/* ============================================================
   Timeline visualization (lanes, nodes, collision layout)
   ============================================================ */
.ee-ps-viz {
    position: relative;
    margin-top: 18px;
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
    padding: 0 0 8px;
}
.ee-ps-viz-inner {
    position: relative;
    margin-left: 108px;
    margin-right: 18px;
}
.ee-ps-lane-label {
    position: absolute;
    left: 14px;
    width: 88px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
}
/* Month grid */
.ee-ps-month-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.ee-ps-month-grid .ee-ps-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.045);
}
.ee-ps-month-row {
    position: relative;
    height: 22px;
}
.ee-ps-month-row span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    top: 5px;
    white-space: nowrap;
}
/* Lanes — heights and rail positions are set by the JS collision layout.
   margin-top keeps tier-0 label stacks clear of the month row (the mockup
   has lifecycle/gantt buffer rows here that we intentionally omit). */
.ee-ps-lanes { position: relative; margin-top: 8px; }
.ee-ps-lane { position: relative; }
.ee-ps-lane .ee-ps-rail {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
}
.ee-ps-lane .ee-ps-rail-fill {
    position: absolute;
    height: 3px;
    border-radius: 2px;
    left: 0;
}
.ee-ps-lane--kunde .ee-ps-rail-fill {
    background: linear-gradient(90deg, #0b7a35, var(--fbv2-accent, #30d158));
    box-shadow: 0 0 8px rgba(48, 209, 88, 0.4);
}
.ee-ps-lane--epc .ee-ps-rail-fill {
    background: linear-gradient(90deg, #5b4a9e, var(--fbv2-purple, #a78bfa));
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.35);
}
.ee-ps-lane.ee-ps-lane-off {
    opacity: 0.18;
    filter: grayscale(1);
}

/* Node = zero-width anchor exactly at the point in time; dot, label stack
   and leader line are absolutely positioned on it (stagger tiers via JS) */
.ee-ps-node {
    position: absolute;
    width: 0;
    top: 0;
    bottom: 0;
}
.ee-ps-node .ee-ps-n-dot {
    position: absolute;
    left: -7.5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 3px solid #16161e;
    z-index: 2;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.16);
}
.ee-ps-n-dot.ee-ps-st-paid {
    background: var(--fbv2-accent, #30d158);
    box-shadow: 0 0 10px rgba(48, 209, 88, 0.7);
}
.ee-ps-n-dot.ee-ps-st-due {
    background: var(--fbv2-amber, #ff9f0a);
    box-shadow: 0 0 10px rgba(255, 159, 10, 0.7);
}
.ee-ps-n-dot.ee-ps-st-invoiced {
    background: var(--fbv2-blue, #64d2ff);
    box-shadow: 0 0 8px rgba(100, 210, 255, 0.5);
}
.ee-ps-n-dot.ee-ps-st-open { background: rgba(255, 255, 255, 0.16); }
.ee-ps-lane--epc .ee-ps-n-dot.ee-ps-st-open { background: rgba(167, 139, 250, 0.28); }
.ee-ps-node .ee-ps-stack {
    position: absolute;
    text-align: center;
    cursor: default;
}
.ee-ps-node .ee-ps-n-name {
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ee-ps-lane--kunde .ee-ps-n-name { color: var(--fbv2-accent, #30d158); }
.ee-ps-lane--epc .ee-ps-n-name { color: var(--fbv2-purple, #a78bfa); }
.ee-ps-node .ee-ps-n-date {
    font-size: 9.5px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    margin-top: 1px;
}
.ee-ps-node .ee-ps-n-date.ee-ps-plan {
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    font-style: italic;
}
.ee-ps-node .ee-ps-n-amt {
    display: inline-block;
    margin-top: 3px;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: 6px;
    padding: 1px 7px;
    background: rgba(17, 17, 24, 0.92);
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
    white-space: nowrap;
    color: var(--fbv2-text, #f2f2f5);
}
.ee-ps-node .ee-ps-n-amt.ee-ps-dimmed {
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    font-weight: 500;
}
/* Leader line: connects dot with vertically staggered label (tier > 0 only) */
.ee-ps-node .ee-ps-leader {
    position: absolute;
    left: -0.5px;
    width: 1px;
    z-index: 1;
    pointer-events: none;
}
.ee-ps-lane--kunde .ee-ps-leader {
    background: linear-gradient(180deg, rgba(48, 209, 88, 0.5), rgba(48, 209, 88, 0.12));
}
.ee-ps-lane--epc .ee-ps-leader {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.12), rgba(167, 139, 250, 0.5));
}

/* Tooltip: full label + date + amount + status (for ALL nodes) */
.ee-ps-viz-tip {
    position: fixed;
    z-index: 100090;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity 0.12s, transform 0.12s;
    background: #15151d;
    border: 1px solid var(--fbv2-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 10px;
    padding: 9px 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
    min-width: 190px;
}
.ee-ps-viz-tip.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.ee-ps-viz-tip .ee-ps-t-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--fbv2-text, #f2f2f5);
}
.ee-ps-viz-tip.ee-ps-tip--kunde .ee-ps-t-name { color: var(--fbv2-accent, #30d158); }
.ee-ps-viz-tip.ee-ps-tip--epc .ee-ps-t-name { color: var(--fbv2-purple, #a78bfa); }
.ee-ps-viz-tip .ee-ps-t-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    margin-top: 5px;
}
.ee-ps-viz-tip .ee-ps-t-row b {
    color: var(--fbv2-text, #f2f2f5);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.ee-ps-viz-tip .ee-ps-t-row b.ee-ps-plan {
    font-style: italic;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    font-weight: 500;
}
/* Today marker */
.ee-ps-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dashed rgba(255, 159, 10, 0.55);
    z-index: 3;
    pointer-events: none;
}
.ee-ps-today-tag {
    position: absolute;
    top: 26px; /* below the month-label row to avoid collisions */
    left: 4px;
    font-size: 8.5px;
    font-weight: 800;
    color: var(--fbv2-amber, #ff9f0a);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 159, 10, 0.12);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}

/* ============================================================
   Reconciliation table
   ============================================================ */
.ee-ps-recon-table {
    width: 100%;
    border-collapse: collapse !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px;
    margin-top: 20px;
}
.ee-ps-recon-table th,
.ee-ps-recon-table td {
    padding: 9px 10px;
    text-align: left;
    border: none !important;
    border-bottom: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.08)) !important;
    background: transparent;
}
.ee-ps-recon-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    font-weight: 600;
}
.ee-ps-recon-table .ee-ps-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ee-ps-ev-name {
    font-weight: 700;
    font-size: 13px;
}
.ee-ps-ev-name--k { color: var(--fbv2-accent, #30d158); }
.ee-ps-ev-name--e { color: var(--fbv2-purple, #a78bfa); }
.ee-ps-ev-detail {
    font-size: 11px;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    font-weight: 500;
}
.ee-ps-trigger-cell {
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    font-size: 12px;
}
.ee-ps-trigger-cell .ee-ps-date { color: var(--fbv2-text, #f2f2f5); }
.ee-ps-trigger-cell .ee-ps-date.ee-ps-plan,
.ee-ps-trigger-cell .ee-ps-plan {
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    font-style: italic;
}
.ee-ps-payer-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ee-ps-payer-tag--kunde {
    color: var(--fbv2-accent, #30d158);
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.25);
}
.ee-ps-payer-tag--epc {
    color: var(--fbv2-purple, #a78bfa);
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.25);
}
.ee-ps-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ee-ps-badge.ee-ps-st-paid {
    color: var(--fbv2-accent, #30d158);
    background: rgba(48, 209, 88, 0.12);
}
.ee-ps-badge.ee-ps-st-due {
    color: var(--fbv2-amber, #ff9f0a);
    background: rgba(255, 159, 10, 0.12);
}
.ee-ps-badge.ee-ps-st-invoiced {
    color: var(--fbv2-blue, #64d2ff);
    background: rgba(100, 210, 255, 0.1);
}
.ee-ps-badge.ee-ps-st-open {
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    background: rgba(255, 255, 255, 0.05);
}
.ee-ps-subtotal-row td {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    font-size: 12px;
}
.ee-ps-total-row td {
    border-top: 2px solid var(--fbv2-border-strong, rgba(255, 255, 255, 0.18)) !important;
    border-bottom: none !important;
    font-weight: 800;
    font-size: 14px;
    padding-top: 12px;
}
.ee-ps-cum { color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6)); }

/* ============================================================
   KPI footer
   ============================================================ */
.ee-ps-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}
@media (max-width: 900px) {
    .ee-ps-kpis { grid-template-columns: 1fr; }
}
.ee-ps-kpi {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
    border-radius: 12px;
    padding: 14px 16px;
    transition: opacity 0.2s;
}
.ee-ps-kpi--kunde { border-left: 3px solid var(--fbv2-accent, #30d158); }
.ee-ps-kpi--epc { border-left: 3px solid var(--fbv2-purple, #a78bfa); }
.ee-ps-kpi--total { border-left: 3px solid var(--fbv2-amber, #ff9f0a); }
.ee-ps-kpi .ee-ps-k-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    font-weight: 600;
}
.ee-ps-kpi .ee-ps-k-val {
    font-size: 22px;
    font-weight: 800;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.ee-ps-kpi .ee-ps-k-val--off {
    font-size: 15px;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
}
.ee-ps-kpi .ee-ps-k-sub {
    font-size: 11px;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    margin-top: 4px;
}
.ee-ps-kpi .ee-ps-k-sub b { color: var(--fbv2-accent, #30d158); }
.ee-ps-kpi--epc .ee-ps-k-sub b { color: var(--fbv2-purple, #a78bfa); }
.ee-ps-kpi.ee-ps-kpi-off {
    opacity: 0.35;
    filter: grayscale(0.8);
}
.ee-ps-progressbar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 8px;
    overflow: hidden;
}
.ee-ps-progressbar > div {
    height: 100%;
    border-radius: 3px;
    background: var(--fbv2-accent, #30d158);
    transition: width 0.3s;
}
.ee-ps-kpi--epc .ee-ps-progressbar > div { background: var(--fbv2-purple, #a78bfa); }
.ee-ps-kpi--total .ee-ps-progressbar > div { background: var(--fbv2-amber, #ff9f0a); }

/* ============================================================
   v2.32.0 — Zahlungs-Meilensteine (Plan vs. Realitaet)
   Override-Markierung + Delta-Warnungen + Inline-Editoren
   ============================================================ */

/* Warn banner (aggregated Mehr-/Minderertrag per pot) */
.ee-ps-override-banner {
    border: 1px solid rgba(255, 159, 10, 0.4);
    border-left: 4px solid var(--fbv2-amber, #ff9f0a);
    background: rgba(255, 159, 10, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 0 14px;
    font-size: 12px;
}
.ee-ps-warn-head {
    font-weight: 800;
    font-size: 13px;
    color: var(--fbv2-amber, #ff9f0a);
    margin-bottom: 6px;
}
.ee-ps-warn-pot { margin: 3px 0; }
.ee-ps-warn-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
}
.ee-ps-warn-list li { margin: 2px 0; }
.ee-ps-delta-pos { color: var(--fbv2-accent, #30d158); font-weight: 700; }
.ee-ps-delta-neg { color: var(--fbv2-red, #ff453a); font-weight: 700; }

/* Source badges on events */
.ee-ps-src-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 5px;
    padding: 1px 6px;
    vertical-align: 1px;
    cursor: help;
}
.ee-ps-src-badge--override {
    color: var(--fbv2-amber, #ff9f0a);
    background: rgba(255, 159, 10, 0.14);
    border: 1px solid rgba(255, 159, 10, 0.35);
}
.ee-ps-src-badge--manual {
    color: var(--fbv2-blue, #64d2ff);
    background: rgba(100, 210, 255, 0.12);
    border: 1px solid rgba(100, 210, 255, 0.3);
}
.ee-ps-src-badge--split {
    color: var(--fbv2-purple, #a78bfa);
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.3);
}
.ee-ps-ev-delta { font-size: 11px; }
.ee-ps-amt-override { color: var(--fbv2-amber, #ff9f0a); font-weight: 700; }
.ee-ps-row-modified > td:first-child {
    box-shadow: inset 3px 0 0 var(--fbv2-amber, #ff9f0a);
}
.ee-ps-row-modified--manual > td:first-child {
    box-shadow: inset 3px 0 0 var(--fbv2-blue, #64d2ff);
}
.ee-ps-row-modified--split > td:first-child {
    box-shadow: inset 3px 0 0 var(--fbv2-purple, #a78bfa);
}

/* Viz node override marker */
.ee-ps-n-ovmark { color: var(--fbv2-amber, #ff9f0a); font-size: 10px; }

/* partial status */
.ee-ps-badge.ee-ps-st-partial {
    color: var(--fbv2-amber, #ff9f0a);
    background: rgba(255, 159, 10, 0.12);
}
.ee-ps-n-dot.ee-ps-st-partial {
    background: linear-gradient(90deg, var(--fbv2-accent, #30d158) 50%, rgba(255, 159, 10, 0.5) 50%);
}

/* Invoice chips */
.ee-ps-inv-chip {
    display: inline-block;
    font-size: 10px;
    border-radius: 6px;
    padding: 1px 7px;
    margin-top: 2px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
}
.ee-ps-inv-chip--paid {
    color: var(--fbv2-accent, #30d158);
    border-color: rgba(48, 209, 88, 0.3);
}

/* Action buttons */
.ee-ps-actions-th { width: 84px; }
.ee-ps-actions-cell { white-space: nowrap; text-align: right; }
.ee-ps-act {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--fbv2-border, rgba(255, 255, 255, 0.09));
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
    border-radius: 6px;
    font-size: 12px;
    padding: 2px 7px;
    margin-left: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.ee-ps-act:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.ee-ps-act--danger:hover {
    color: var(--fbv2-red, #ff453a);
    border-color: rgba(255, 69, 58, 0.4);
    background: rgba(255, 69, 58, 0.1);
}
.ee-ps-act-add { font-size: 11px; font-weight: 700; }

/* Inline editor */
.ee-ps-editor-row > td { background: rgba(0, 0, 0, 0.3) !important; }
.ee-ps-editor {
    padding: 12px 8px;
    border: 1px dashed rgba(255, 159, 10, 0.35);
    border-radius: 10px;
}
.ee-ps-editor-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--fbv2-amber, #ff9f0a);
}
.ee-ps-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 900px) {
    .ee-ps-editor-grid { grid-template-columns: 1fr 1fr; }
}
.ee-ps-editor-grid label {
    display: block;
    font-size: 11px;
    color: var(--fbv2-text-dim, rgba(255, 255, 255, 0.6));
}
.ee-ps-editor-grid input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    font-size: 13px;
}
.ee-ps-editor-btns { margin-top: 12px; display: flex; gap: 8px; }
.ee-ps-editor-btns .btn { font-size: 12px; padding: 6px 14px; }

/* Split editor */
.ee-ps-split-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.ee-ps-split-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fbv2-text-faint, rgba(255, 255, 255, 0.38));
    padding: 4px 6px;
}
.ee-ps-split-table td { padding: 3px 6px; }
.ee-ps-split-table input, .ee-ps-split-table select {
    width: 100%;
    padding: 5px 8px;
    font-size: 13px;
}
