/* =================================================================
   ERP-NG  –  site.css
   Helles, datendichtes ERP-Design (angelehnt an PreloDoc)
   Dunkelblaue Sidebar · Gold-Akzent · helle Inhaltsflächen
   ================================================================= */

:root {
    /* Markenfarben */
    --pd-blue:        #1A4A7A;   /* Primär (dunkelblau) */
    --pd-blue-dark:   #143a61;
    --pd-blue-700:    #1b6ec2;   /* Link/Button-Blau */
    --pd-gold:        #f0a500;   /* Akzent */
    --pd-gold-dark:   #c48800;

    /* Sidebar */
    --sb-bg:          #16344f;   /* dunkelblauer Verlaufsgrund */
    --sb-bg-2:        #122a40;
    --sb-text:        rgba(255,255,255,.78);
    --sb-text-soft:   rgba(255,255,255,.50);
    --sb-hover:       rgba(255,255,255,.07);
    --sb-active:      rgba(240,165,0,.16);
    --sb-section:     rgba(255,255,255,.42);

    /* Flächen */
    --bg:             #eef2f7;   /* App-Hintergrund */
    --surface:        #ffffff;   /* Karten */
    --surface-2:      #f8fafc;
    --surface-3:      #f1f5f9;

    /* Text */
    --text:           #1e293b;
    --text-soft:      #64748b;
    --text-muted:     #94a3b8;

    /* Linien & Status */
    --border:         #e2e8f0;
    --border-soft:    #f1f5f9;
    --success:        #16a34a;  --success-bg: #dcfce7;
    --warning:        #d97706;  --warning-bg: #fef3c7;
    --danger:         #dc2626;  --danger-bg:  #fef2f2;
    --info:           #1e40af;  --info-bg:    #dbeafe;

    --radius:         10px;
    --radius-sm:      8px;
    --radius-lg:      12px;
    --shadow-sm:      0 1px 2px rgba(15,23,42,.04);
    --shadow:         0 1px 3px rgba(15,23,42,.08);
    --shadow-md:      0 8px 30px rgba(15,23,42,.12);

    --sidebar-w:      236px;
    --topbar-h:       56px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ===================== SHELL ===================== */
.pd-shell { display: flex; min-height: 100vh; }

/* ===================== SIDEBAR ===================== */
.pd-sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
    color: var(--sb-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 60;
    transition: transform .26s cubic-bezier(.4,0,.2,1);
}

.pd-sidebar-logo {
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.pd-brand { display: inline-flex; align-items: center; gap: 11px; }
.pd-brand-badge {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--pd-blue);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.pd-brand-badge .pd-erp { color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .3px; }
.pd-brand-badge .pd-dot {
    position: absolute; top: -3px; right: -3px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--pd-gold);
    border: 2px solid #fff;
}
.pd-brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.pd-brand-text .pd-bt-main {
    font-size: 17px; font-weight: 700; color: var(--pd-blue);
    display: inline-flex; align-items: flex-start;
}
.pd-brand-text .pd-bt-main sup { font-size: .55em; color: var(--pd-gold-dark); font-weight: 700; margin-left: 1px; top: -.1em; }
.pd-brand-text .pd-bt-sub { font-size: 9px; letter-spacing: 2px; color: var(--pd-gold-dark); font-weight: 600; }

/* Navigation */
.pd-nav { flex: 1; overflow-y: auto; padding: 8px 0 14px; }
.pd-nav svg { width: 17px; height: 17px; }   /* Schutz: nie auf SVG-Standardgröße aufgehen */
.pd-nav::-webkit-scrollbar { width: 8px; }
.pd-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.pd-nav-section {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--sb-section);
    font-weight: 700;
    padding: 14px 18px 5px;
}

/* Abstand zwischen Navigationsgruppen (ersetzt frühere Section-Überschriften) */
.pd-nav-group-trigger { margin-top: 6px; }
.pd-nav > a + .pd-nav-group-trigger,
.pd-nav-subitems + a,
.pd-nav-subitems + .pd-nav-group-trigger { margin-top: 6px; }
.pd-nav > a:first-child,
.pd-nav > .pd-nav-group-trigger:first-child { margin-top: 0; }

.pd-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: var(--sb-text);
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .14s, color .14s, border-color .14s;
}
.pd-nav-item:hover { background: var(--sb-hover); color: #fff; }
.pd-nav-item.active {
    background: var(--sb-active);
    color: #fff;
    border-left-color: var(--pd-gold);
    font-weight: 600;
}
.pd-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.pd-nav-item.active svg { opacity: 1; }
.pd-nav-label { flex: 1; white-space: nowrap; }
.pd-nav-badge {
    margin-left: auto;
    min-width: 18px; height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--pd-gold);
    color: var(--pd-blue);
    font-size: 11px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Aufklappbare Gruppe */
.pd-nav-group-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 18px;
    background: none; border: none;
    border-left: 3px solid transparent;
    color: var(--sb-text);
    font-size: 13px; font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .14s, color .14s;
}
.pd-nav-group-trigger:hover { background: var(--sb-hover); color: #fff; }
.pd-nav-group-trigger .pd-nav-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; flex-shrink: 0; opacity: .85;
}
.pd-nav-group-trigger .pd-nav-ico svg { width: 17px; height: 17px; }
.pd-nav-group-trigger .pd-chevron {
    display: inline-flex; align-items: center; justify-content: center;
    width: 13px; height: 13px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: .55;
    transition: transform .2s;
}
.pd-nav-group-trigger .pd-chevron svg { width: 13px; height: 13px; }
.pd-nav-group-trigger.open { color: #fff; }
.pd-nav-group-trigger.open .pd-chevron { transform: rotate(90deg); opacity: .85; }

.pd-nav-subitems { display: none; padding: 2px 0 4px; }
.pd-nav-subitems.open { display: block; }
.pd-nav-subsection {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--pd-gold);
    font-weight: 700;
    padding: 12px 18px 5px 28px;
    margin-top: 4px;
    opacity: .85;
}
.pd-nav-subitems .pd-nav-item {
    padding-left: 47px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--sb-text-soft);
}
.pd-nav-subitems .pd-nav-item:hover { color: #fff; }
.pd-nav-subitems .pd-nav-item.active { color: #fff; }

/* Sidebar-Footer */
.pd-sidebar-foot {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.pd-sb-avatar {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--pd-gold); color: var(--pd-blue);
    font-weight: 800; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pd-sb-user { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pd-sb-user .pd-sb-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.pd-sb-user .pd-sb-role { font-size: 11px; color: var(--sb-text-soft); }

/* Overlay (mobil) */
.pd-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; }
.pd-overlay.show { display: block; }

/* ===================== MAIN ===================== */
.pd-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.pd-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky; top: 0;
    z-index: 40;
}
.pd-hamburger {
    display: none;
    flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 6px;
}
.pd-hamburger span { width: 20px; height: 2px; border-radius: 2px; background: var(--text); }

/* Breadcrumb */
.pd-breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 14px; min-width: 0; }
.pd-breadcrumb a { color: var(--pd-blue-700); }
.pd-breadcrumb a:hover { text-decoration: underline; }
.pd-breadcrumb .pd-bc-sep { color: var(--text-muted); }
.pd-breadcrumb .pd-bc-current { color: var(--text); font-weight: 600; white-space: nowrap; }

/* Topbar-Suche */
.pd-topbar-search {
    flex: 1; max-width: 360px; margin-left: auto;
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--text-muted);
}
.pd-topbar-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.pd-topbar-search input {
    border: none; background: none; outline: none;
    font-size: 13px; color: var(--text); width: 100%;
    font-family: inherit;
}
.pd-topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pd-icon-btn {
    position: relative;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .14s, color .14s, border-color .14s;
}
.pd-icon-btn:hover { background: var(--surface-3); color: var(--pd-blue); }
.pd-icon-btn svg { width: 17px; height: 17px; }
.pd-badge-dot {
    position: absolute; top: 7px; right: 8px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--surface);
}

/* Inhalt */
.pd-content { padding: 20px; flex: 1; }
.pd-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12.5px;
    display: flex; justify-content: space-between;
    background: var(--surface);
}

/* ===================== KOMPONENTEN ===================== */

/* Page header */
.pd-page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.pd-page-head h1 { font-size: 18px; margin: 0; font-weight: 700; }
.pd-page-head .pd-sub { color: var(--text-soft); margin: 2px 0 0; font-size: 13px; }

/* Buttons */
.pd-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .14s, border-color .14s;
}
.pd-btn:hover { background: var(--surface-3); }
.pd-btn svg { width: 15px; height: 15px; }
.pd-btn-primary {
    background: var(--pd-blue); border-color: var(--pd-blue); color: #fff;
}
.pd-btn-primary:hover { background: var(--pd-blue-dark); }
.pd-btn-gold {
    background: var(--pd-gold); border-color: var(--pd-gold); color: var(--pd-blue);
}
.pd-btn-gold:hover { background: var(--pd-gold-dark); color: #fff; }

/* Cards */
.pd-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.pd-card-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600;
}
.pd-card-head .pd-link { font-size: 12.5px; font-weight: 500; color: var(--pd-blue-700); cursor: pointer; }
.pd-card-head .pd-link:hover { text-decoration: underline; }
.pd-card-body { padding: 16px; }

/* KPI-Karten */
.pd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.pd-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: box-shadow .15s, transform .15s;
}
.pd-kpi:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pd-kpi-top { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; }
.pd-kpi-top svg { width: 15px; height: 15px; flex-shrink: 0; }
.pd-kpi-ico-blue   { color: var(--pd-blue); }
.pd-kpi-ico-gold   { color: var(--pd-gold-dark); }
.pd-kpi-ico-green  { color: var(--success); }
.pd-kpi-ico-amber  { color: var(--warning); }
.pd-kpi-ico-cyan   { color: #0891b2; }
.pd-kpi-value { font-size: 24px; font-weight: 700; color: var(--text); margin-top: 6px; }
.pd-kpi-foot { font-size: 11.5px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.pd-kpi-foot svg { width: 13px; height: 13px; }
.pd-up   { color: var(--success); }
.pd-down { color: var(--danger); }

/* Tabellen */
.pd-table-wrap { overflow-x: auto; }
table.pd-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
table.pd-table thead th {
    text-align: left;
    padding: 9px 16px;
    color: var(--text-muted);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-2);
}
table.pd-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
table.pd-table tbody tr:last-child td { border-bottom: none; }
table.pd-table tbody tr { transition: background .1s; }
table.pd-table tbody tr:hover { background: var(--surface-2); }
table.pd-table .pd-strong { font-weight: 600; color: var(--text); }

/* Badges */
.pd-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
}
.pd-badge-success { color: var(--success); background: var(--success-bg); }
.pd-badge-warning { color: var(--warning); background: var(--warning-bg); }
.pd-badge-danger  { color: var(--danger);  background: var(--danger-bg); }
.pd-badge-info    { color: var(--info);    background: var(--info-bg); }

/* Grid-Helper */
.pd-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* Liste */
.pd-list { list-style: none; margin: 0; padding: 0; }
.pd-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.pd-list li:last-child { border-bottom: none; }
.pd-list-avatar {
    width: 36px; height: 36px; border-radius: 9px;
    background: var(--info-bg); color: var(--info);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.pd-list-main { flex: 1; min-width: 0; }
.pd-list-title { font-weight: 600; font-size: 13px; }
.pd-list-sub { color: var(--text-soft); font-size: 12px; }
.pd-list-amount { font-weight: 700; font-size: 13px; }

/* Formular */
.pd-form-row { margin-bottom: 14px; }
.pd-form-row label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.pd-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px; font-family: inherit;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}
.pd-control:focus { border-color: var(--pd-blue-700); box-shadow: 0 0 0 3px rgba(27,110,194,.12); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    .pd-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .pd-sidebar { transform: translateX(-100%); }
    .pd-sidebar.open { transform: translateX(0); }
    .pd-main { margin-left: 0; }
    .pd-hamburger { display: flex; }
    .pd-topbar-search { display: none; }
    .pd-content { padding: 16px; }
}
@media (max-width: 480px) {
    .pd-kpi-grid { grid-template-columns: 1fr; }
    .pd-footer { flex-direction: column; gap: 4px; align-items: flex-start; }
    .pd-breadcrumb .pd-bc-hide { display: none; }
}

/* ===================== KUNDENLISTE (CRM) ===================== */

/* Filter-Grid */
.pd-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* Kleiner Button + Sekundärvariante */
.pd-btn-sm { padding: 5px 11px; font-size: 12px; }

/* Zähl-Pille im Card-Header */
.pd-count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px;
    margin-left: 6px;
    border-radius: 10px;
    background: var(--info-bg); color: var(--info);
    font-size: 12px; font-weight: 700;
}

/* Ansichts-Umschalter */
.pd-view-toggle { display: inline-flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: var(--radius-sm); }
.pd-vt-btn {
    width: 30px; height: 28px;
    border: none; background: none; border-radius: 6px;
    color: var(--text-soft); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.pd-vt-btn svg { width: 16px; height: 16px; }
.pd-vt-btn.active { background: var(--surface); color: var(--pd-blue); box-shadow: var(--shadow-sm); }

/* Zelle mit Avatar + Text */
.pd-cell-main { display: flex; align-items: center; gap: 10px; }
.pd-muted { color: var(--text-muted); font-size: 12px; }

/* Sortierbare Header */
th.pd-sortable { cursor: pointer; user-select: none; position: relative; padding-right: 22px; }
th.pd-sortable:hover { color: var(--pd-blue); }
th.pd-sortable::after {
    content: "⇅"; position: absolute; right: 8px; opacity: .3; font-size: 11px;
}
th.pd-sortable.sort-asc::after  { content: "↑"; opacity: .9; color: var(--pd-blue); }
th.pd-sortable.sort-desc::after { content: "↓"; opacity: .9; color: var(--pd-blue); }

/* Kategorie-Badge (neutral) */
.pd-badge-cat { color: var(--pd-blue); background: #eef3f9; }

/* Leerzustand / Fehler */
.pd-empty { text-align: center; color: var(--text-muted); padding: 28px 16px !important; }
.pd-empty.pd-error { color: var(--danger); }

/* Kartenansicht */
.pd-client-cards {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 16px;
}
.pd-client-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--surface);
    transition: box-shadow .15s, transform .15s;
}
.pd-client-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pd-cc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pd-cc-title { min-width: 0; }
.pd-cc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pd-cc-info { font-size: 12.5px; color: var(--text-soft); display: flex; flex-direction: column; gap: 3px; }
.pd-cc-foot { margin-top: 12px; }

/* Pager */
.pd-pager {
    display: flex; align-items: center; gap: 4px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pd-page-btn {
    min-width: 32px; height: 32px; padding: 0 8px;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text); font-size: 13px;
    transition: background .12s, border-color .12s;
}
.pd-page-btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--pd-blue-700); }
.pd-page-btn.active { background: var(--pd-blue); color: #fff; border-color: var(--pd-blue); }
.pd-page-btn:disabled { opacity: .4; cursor: default; }
.pd-page-info { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }

/* ============================================================
   AUTH-Seiten (Login / 2FA) – eigenständiges Layout
   ============================================================ */
.pd-auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
    font-family: inherit;
    padding: 24px;
}
.pd-auth-wrap { width: 100%; max-width: 400px; }
.pd-auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 48px rgba(8,20,35,.35);
    padding: 34px 30px 30px;
}
.pd-auth-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 22px;
}
.pd-auth-badge {
    position: relative;
    background: var(--pd-blue);
    color: #fff; font-weight: 800; font-size: 13px;
    letter-spacing: .5px;
    padding: 7px 10px; border-radius: 8px;
}
.pd-auth-dot {
    display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--pd-gold);
    margin-left: 3px; vertical-align: middle;
}
.pd-auth-title { font-size: 18px; font-weight: 800; color: var(--text); }
.pd-auth-title sup { color: var(--pd-gold); font-size: 10px; }
.pd-auth-head { font-size: 21px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.pd-auth-sub { font-size: 13px; color: var(--text-soft); margin: 0 0 22px; }
.pd-auth-alert {
    background: var(--danger-bg); color: var(--danger);
    border: 1px solid #fecaca; border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 13px; margin-bottom: 18px;
}
.pd-auth-remember {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-soft);
    margin: 4px 0 22px; cursor: pointer; user-select: none;
}
.pd-auth-remember input { width: 15px; height: 15px; accent-color: var(--pd-blue); }
.pd-auth-submit { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.pd-auth-code {
    letter-spacing: 8px; text-align: center;
    font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pd-auth-back {
    display: block; text-align: center; margin-top: 18px;
    font-size: 12.5px; color: var(--text-soft); text-decoration: none;
}
.pd-auth-back:hover { color: var(--pd-blue); }
.pd-auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.55); }

/* ============================================================
   Sidebar-Benutzermenü (Abmelden)
   ============================================================ */
.pd-sidebar-foot { position: relative; }
.pd-sb-userbtn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; background: transparent; border: 0;
    padding: 0; cursor: pointer; text-align: left;
    border-radius: 8px;
}
.pd-sb-userbtn:hover { background: var(--sb-hover); }
.pd-sb-caret {
    margin-left: auto; color: var(--sb-text-soft);
    display: inline-flex; transition: transform .18s ease;
}
.pd-sb-caret svg { width: 16px; height: 16px; }
.pd-sb-userbtn.open .pd-sb-caret { transform: rotate(180deg); }
.pd-sb-menu {
    display: none; position: absolute;
    left: 14px; right: 14px; bottom: calc(100% - 2px);
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(8,20,35,.4);
    overflow: hidden; z-index: 60;
}
.pd-sb-menu.open { display: block; }
.pd-sb-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; font-size: 13px; color: var(--text);
    text-decoration: none;
}
.pd-sb-menu-item:hover { background: var(--surface-3); }
.pd-sb-menu-item svg { width: 17px; height: 17px; color: var(--text-soft); }

/* ============================================================
   Empty-State (z. B. Kein Zugriff)
   ============================================================ */
.pd-empty-state {
    max-width: 440px; margin: 60px auto; text-align: center;
}
.pd-empty-state .pd-empty-ico {
    width: 64px; height: 64px; margin: 0 auto 18px;
    border-radius: 16px; background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.pd-empty-state .pd-empty-ico svg { width: 30px; height: 30px; }
.pd-empty-state h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.pd-empty-state .pd-sub { font-size: 14px; color: var(--text-soft); margin: 0 0 22px; }

/* ============================================================
   KUNDEN-DETAILSEITE – Avatar, Tabs, Detail-Listen, Notizen
   ============================================================ */
.pd-detail-avatar {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--pd-blue); color: #fff;
    font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Tabs */
.pd-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.pd-tab {
    display: inline-flex; align-items: center; gap: 7px;
    background: transparent; border: 0; cursor: pointer;
    padding: 11px 16px; font-size: 13px; font-weight: 600;
    color: var(--text-soft); border-bottom: 2px solid transparent;
    margin-bottom: -1px; border-radius: 8px 8px 0 0;
}
.pd-tab svg { width: 16px; height: 16px; }
.pd-tab:hover { color: var(--pd-blue); background: var(--surface-3); }
.pd-tab.active { color: var(--pd-blue); border-bottom-color: var(--pd-gold); }

.pd-tabpane { display: none; }
.pd-tabpane.active { display: block; animation: pdFade .18s ease; }
@keyframes pdFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Definition-Liste */
.pd-dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; margin: 0; }
.pd-dl dt { color: var(--text-soft); font-size: 12.5px; }
.pd-dl dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 500; }
.pd-dl a { color: var(--pd-blue-700); text-decoration: none; }
.pd-dl a:hover { text-decoration: underline; }

/* Notizen */
.pd-note {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2);
}
.pd-note:last-child { margin-bottom: 0; }
.pd-note-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-soft); margin-bottom: 5px;
}
.pd-note-meta strong { color: var(--text); }
.pd-note-text { margin: 0; font-size: 13px; white-space: pre-wrap; }

/* Checkbox-Label */
.pd-check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
}
.pd-check input { width: 15px; height: 15px; accent-color: var(--pd-blue); }

/* Zusätzliche Badge-/Button-Varianten */
.pd-badge-gold { background: rgba(240,165,0,.16); color: var(--pd-gold-dark); }
.pd-btn-danger {
    background: var(--danger); color: #fff; border-color: var(--danger);
}
.pd-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* Empty-Zelle in Tabellen */
td.pd-empty { text-align: center; color: var(--text-muted); padding: 22px 12px; }

/* ============================================================
   MODALS
   ============================================================ */
.pd-modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 80;
    background: rgba(15,23,42,.5);
    align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.pd-modal-backdrop.open { display: flex; }
.pd-modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(8,20,35,.4);
    width: 100%; max-width: 540px; margin: auto;
    animation: pdModalIn .2s ease;
}
.pd-modal-sm { max-width: 420px; }
.pd-modal-lg { max-width: 760px; }
@keyframes pdModalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.pd-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.pd-modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.pd-modal-close {
    background: transparent; border: 0; cursor: pointer;
    font-size: 24px; line-height: 1; color: var(--text-muted); padding: 0 4px;
}
.pd-modal-close:hover { color: var(--text); }
.pd-modal-body { padding: 20px; }
.pd-modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--border);
    background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.pd-modal-body .pd-form-row { margin-bottom: 12px; }
.pd-modal-body .pd-form-row label { font-size: 12.5px; color: var(--text-soft); }

/* ============================================================
   KUNDEN-ANLAGE – Dublettenwarnung
   ============================================================ */
.pd-dupe-warn {
    background: var(--warning-bg);
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.pd-dupe-head {
    display: flex; align-items: center; gap: 8px;
    color: var(--warning); font-size: 14px;
}
.pd-dupe-head svg { width: 18px; height: 18px; }
.pd-dupe-item {
    display: flex; flex-direction: column;
    padding: 8px 12px; margin-top: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); text-decoration: none;
}
.pd-dupe-item:hover { border-color: var(--pd-blue); }
.pd-dupe-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pd-dupe-meta { font-size: 12px; color: var(--text-soft); }

/* ============================================================
   SVG-CHARTS (eigenständig, keine Library)
   ============================================================ */
.pd-chart { width: 100%; height: auto; max-height: 260px; display: block; }
.pd-chart-grid { stroke: var(--border); stroke-width: 1; }
.pd-chart-axis { fill: var(--text-muted); font-size: 11px; }
.pd-chart-val { fill: var(--text-soft); font-size: 11px; font-weight: 600; }
.pd-chart-bar { fill: var(--pd-blue); transition: fill .15s ease; }
.pd-chart-bar:hover { fill: var(--pd-gold); }
.pd-chart-bar-neg { fill: var(--danger); transition: fill .15s ease; }
.pd-chart-bar-neg:hover { fill: var(--pd-gold); }

/* Linien-Chart (Customer Tracking) */
.pd-chart-line {
    fill: none; stroke: var(--pd-blue); stroke-width: 2.5;
    stroke-linejoin: round; stroke-linecap: round;
}
.pd-chart-area { fill: var(--pd-blue); opacity: .08; }
.pd-chart-dot { fill: var(--pd-blue); stroke: #fff; stroke-width: 1.5; }

/* Pager-Info-Text */
.pd-pager-info { font-size: 13px; color: var(--text-soft); margin: 0 10px; }

/* ============================================================
   Fortschrittsbalken (Efficiency-Grade)
   ============================================================ */
.pd-progress {
    flex: 1; min-width: 80px; height: 8px;
    background: var(--surface-3); border-radius: 999px; overflow: hidden;
}
.pd-progress-bar { height: 100%; border-radius: 999px; transition: width .3s ease; }
.pd-progress-success { background: var(--success); }
.pd-progress-warning { background: var(--warning); }
.pd-progress-danger  { background: var(--danger); }

/* ============================================================
   Searchable Select (durchsuchbare Comboboxen, eigene Komponente)
   ============================================================ */
.pd-ss { position: relative; }
.pd-ss-native {
    /* nativen Select aus dem Layout nehmen, aber für Formulare erhalten */
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); border: 0;
    opacity: 0; pointer-events: none;
}
.pd-ss-input { cursor: text; padding-right: 34px; width: 100%; }
.pd-ss-caret {
    position: absolute; top: 0; right: 0; height: 100%;
    width: 32px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; pointer-events: auto;
}
.pd-ss-caret svg { width: 16px; height: 16px; transition: transform .18s ease; }
.pd-ss.open .pd-ss-caret svg { transform: rotate(180deg); }

.pd-ss-panel {
    display: none;
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(8,20,35,.18);
    max-height: 260px; overflow-y: auto;
    z-index: 90;
}
.pd-ss-panel.open { display: block; }
.pd-ss-item {
    padding: 8px 12px; font-size: 13px; color: var(--text);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-ss-item:hover, .pd-ss-item.active { background: var(--surface-3); }
.pd-ss-item.selected { font-weight: 600; color: var(--pd-blue-700); }
.pd-ss-item.active.selected { background: var(--surface-3); }
.pd-ss-empty { padding: 10px 12px; font-size: 13px; color: var(--text-muted); }

/* ============================================================
   Rechte-Badge in der Topbar (zeigt benötigtes Recht der Seite)
   ============================================================ */
.pd-right-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: rgba(26,74,122,.08);
    border: 1px solid var(--border);
    color: var(--pd-blue-700);
    font-size: 11.5px; font-weight: 600;
    white-space: nowrap; cursor: default;
}
.pd-right-badge svg { width: 14px; height: 14px; opacity: .8; }
@media (max-width: 760px) {
    .pd-right-badge-text { display: none; }   /* auf Mobil nur das Schild-Icon */
    .pd-right-badge { padding: 5px; }
}

/* ============================================================
   DETAIL-SEITEN: Hero-Header, Meta, Sektionen, Timeline, Dateien
   (verwendet u.a. auf der Task-Detailseite)
   ============================================================ */

/* Hero-Header mit Farbverlauf */
.pd-hero {
    position: relative;
    background: linear-gradient(135deg, var(--pd-blue) 0%, var(--pd-blue-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(18,42,64,.18);
    overflow: hidden;
}
.pd-hero::after {
    content: "";
    position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.pd-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.pd-hero-id { font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 600; }
.pd-hero h1 { margin: 4px 0 10px; color: #fff; font-size: 22px; line-height: 1.25; }
.pd-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pd-hero-actions { display: flex; gap: 8px; flex-shrink: 0; position: relative; z-index: 1; }
.pd-hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.pd-hero-meta > div { font-size: 13px; }
.pd-hero-meta dt { color: rgba(255,255,255,.65); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.pd-hero-meta dd { margin: 0; color: #fff; font-weight: 600; }

/* Helle Buttons auf dem Hero */
.pd-hero .pd-btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }
.pd-hero .pd-btn:hover { background: rgba(255,255,255,.24); }
.pd-hero .pd-btn-primary { background: var(--pd-gold); color: #3a2c00; border-color: transparent; }
.pd-hero .pd-btn-primary:hover { background: var(--pd-gold-dark); }

/* Badge mit weicher Tönung */
.pd-badge-soft { background: rgba(255,255,255,.18); color: #fff; }

/* Sektion-Titel innerhalb von Karten */
.pd-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--text);
    text-transform: uppercase; letter-spacing: .4px;
}
.pd-section-title svg { width: 16px; height: 16px; color: var(--pd-blue); }

/* Definition-Liste als 2-Spalten-Grid (schöner als float) */
.pd-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 0; }
.pd-meta-grid .pd-meta-item { display: flex; flex-direction: column; gap: 2px; }
.pd-meta-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 600; }
.pd-meta-grid dd { margin: 0; font-size: 14px; color: var(--text); font-weight: 500; }
@media (max-width: 640px) { .pd-meta-grid { grid-template-columns: 1fr; } }

/* Datei-Liste mit Icon-Kacheln */
.pd-file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.pd-file-row:last-child { border-bottom: 0; }
.pd-file-ico {
    width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
    background: rgba(26,74,122,.08); color: var(--pd-blue);
    display: flex; align-items: center; justify-content: center;
}
.pd-file-ico svg { width: 18px; height: 18px; }
.pd-file-info { flex: 1; min-width: 0; }
.pd-file-name { font-weight: 600; font-size: 13.5px; color: var(--text); word-break: break-all; }
.pd-file-sub { font-size: 12px; color: var(--text-muted); }
.pd-file-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Timeline für Verlauf/Kommentare */
.pd-timeline { position: relative; margin: 0; padding: 0; }
.pd-timeline-item { position: relative; padding: 0 0 18px 26px; }
.pd-timeline-item::before {
    content: ""; position: absolute; left: 6px; top: 18px; bottom: -4px;
    width: 2px; background: var(--border);
}
.pd-timeline-item:last-child::before { display: none; }
.pd-timeline-dot {
    position: absolute; left: 0; top: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--pd-blue);
}
.pd-timeline-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.pd-timeline-user { font-weight: 600; font-size: 13.5px; color: var(--text); }
.pd-timeline-date { font-size: 12px; color: var(--text-muted); }
.pd-timeline-text { margin: 0; font-size: 13.5px; color: var(--text-soft); white-space: pre-wrap; line-height: 1.5; }

/* Kosten-Tabelle: Summenzeile hervorheben */
.pd-table tfoot td, .pd-table .pd-row-total td {
    font-weight: 700; color: var(--text);
    border-top: 2px solid var(--border); background: var(--surface-2);
}

/* Beschreibungs-Box */
.pd-prose { white-space: pre-wrap; margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-soft); }
.pd-prose-empty { color: var(--text-muted); font-style: italic; }

/* ============================================================
   ZEITERFASSUNG: Schnellfilter-Chips & laufender Tracker
   ============================================================ */
.pd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-soft);
    border: 1px solid var(--border); font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all .15s ease;
    white-space: nowrap;
}
.pd-chip:hover { background: var(--surface-3); color: var(--text); }
.pd-chip.active {
    background: var(--pd-blue); color: #fff; border-color: var(--pd-blue);
    box-shadow: 0 2px 8px rgba(26,74,122,.25);
}

/* Laufender Tracker – Hero-Variante */
.pd-tracker-live {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 20px 24px;
    margin-bottom: 18px; box-shadow: 0 8px 24px rgba(20,83,45,.2);
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.pd-tracker-live .pd-tl-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.7); font-weight: 600; }
.pd-tracker-live .pd-tl-title { font-size: 18px; font-weight: 700; margin: 2px 0; }
.pd-tracker-live .pd-tl-meta { font-size: 13px; color: rgba(255,255,255,.85); }
.pd-tracker-live .pd-tl-timer { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.pd-tracker-live .pd-tl-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: #4ade80; margin-right: 6px; animation: pd-pulse 1.4s ease-in-out infinite;
}
@keyframes pd-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.pd-tracker-live .pd-btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.pd-tracker-live .pd-btn:hover { background: rgba(255,255,255,.28); }
.pd-tracker-live .pd-btn-danger { background: #fff; color: #b91c1c; border-color: #fff; }
.pd-tracker-live .pd-btn-danger:hover { background: #fee2e2; }

/* Buchhaltung: kleiner Hinweis-Kasten (z.B. enthaltene USt) */
.pd-note-box {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; color: var(--text-soft);
}

/* Buchhaltung: Kontenklassen-Übersicht */
.pd-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pd-class-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px;
}
.pd-class-nr {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: none; border-radius: 8px;
    background: var(--pd-blue); color: #fff; font-weight: 700; font-size: 16px;
}
.pd-class-name { font-size: 13px; color: var(--text-soft); line-height: 1.3; }

/* ============================================================
   GESCHÄFTSFÜHRUNG: Dokumente (Drag&Drop) + Inventar
   ============================================================ */
.pd-dropzone {
    border: 2px dashed var(--border); border-radius: var(--radius-lg);
    background: var(--surface-2); padding: 32px 20px; text-align: center;
    cursor: pointer; transition: all .18s ease;
}
.pd-dropzone:hover { border-color: var(--pd-blue); background: var(--surface-3); }
.pd-dropzone.dragover { border-color: var(--pd-blue); background: #e8f0f9; transform: scale(1.005); }
.pd-dropzone-inner { pointer-events: none; }
.pd-dropzone-ico { display: inline-flex; width: 44px; height: 44px; color: var(--pd-blue); margin-bottom: 6px; }
.pd-dropzone-ico svg { width: 44px; height: 44px; }
.pd-dropzone-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 4px 0 2px; }
.pd-dropzone-link { color: var(--pd-blue); text-decoration: underline; }
.pd-dropzone-hint { font-size: 12px; color: var(--text-muted); margin: 0; }

.pd-upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.pd-upload-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.pd-upload-row .pd-up-name { flex: 1; font-size: 13px; font-weight: 500; word-break: break-all; }
.pd-upload-row .pd-up-size { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pd-upload-row .pd-up-del { cursor: pointer; color: var(--danger); font-weight: 700; border: none; background: none; font-size: 16px; line-height: 1; }

/* Datei-Typ-Badge (Liste) */
.pd-file-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 26px; padding: 0 6px; border-radius: 6px;
    background: var(--pd-blue); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px;
}

/* Inventar-Karten */
.pd-inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pd-inv-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px; transition: box-shadow .15s ease, transform .15s ease;
}
.pd-inv-card:hover { box-shadow: 0 6px 18px rgba(18,42,64,.08); transform: translateY(-1px); }
.pd-inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pd-inv-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.pd-inv-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-soft); }
.pd-inv-meta-row { display: flex; align-items: center; gap: 6px; }
.pd-inv-meta-row .pd-inv-ico { width: 15px; height: 15px; color: var(--text-muted); flex: none; }
.pd-inv-meta-row .pd-inv-ico svg { width: 15px; height: 15px; }
.pd-inv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.pd-inv-amount { font-size: 16px; font-weight: 700; color: var(--pd-blue); }

/* Mitarbeiterkosten: Deckungsbeitrag-Balken in der Tabelle */
.pd-db-cell { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 22px; }
.pd-db-bar { position: absolute; right: 0; top: 50%; transform: translateY(-50%); height: 18px; border-radius: 4px; opacity: .18; z-index: 0; }
.pd-db-bar.pos { background: var(--success); }
.pd-db-bar.neg { background: var(--danger); }
.pd-db-val { position: relative; z-index: 1; font-weight: 700; white-space: nowrap; }

/* ============================================================
   MITARBEITERKOSTEN: Executive Dashboard
   ============================================================ */
/* Hero: Jahres-Deckungsbeitrag */
.pd-hero-db {
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    border-radius: var(--radius-lg); padding: 22px 28px; margin-bottom: 16px;
    color: #fff; background: linear-gradient(135deg, #16344f, #1A4A7A);
    box-shadow: 0 8px 24px rgba(18,42,64,.18); flex-wrap: wrap;
}
.pd-hero-db.neg { background: linear-gradient(135deg, #7a2230, #b23a48); }
.pd-hero-db-left { display: flex; flex-direction: column; gap: 2px; }
.pd-hero-db-label { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; opacity: .85; }
.pd-hero-db-value { font-size: 34px; font-weight: 800; line-height: 1.1; }
.pd-hero-db-sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.pd-hero-db-right { display: flex; gap: 28px; }
.pd-hero-db-stat { display: flex; flex-direction: column; align-items: center; }
.pd-hero-db-stat-val { font-size: 24px; font-weight: 800; line-height: 1; }
.pd-hero-db-stat-val[style] { /* eingefärbt für profitabel/verlust auf dunklem Grund */ filter: brightness(1.6); }
.pd-hero-db-stat-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; margin-top: 4px; }

/* Chart-Legende */
.pd-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 12px; }
.pd-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.pd-legend-dot { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }

/* Nulllinie betont */
.pd-chart-zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: none; opacity: .55; }

/* ============================================================
   MITARBEITERKOSTEN: P&L-Hero + Chart.js-Container
   ============================================================ */
.pd-hero-pnl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 720px) { .pd-hero-pnl { grid-template-columns: 1fr; } }
.pd-hero-pnl-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px 22px 18px 26px;
    box-shadow: 0 1px 2px rgba(18,42,64,.04);
    display: flex; flex-direction: column; gap: 4px;
}
/* farbiger Akzentstreifen links */
.pd-hero-pnl-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.pd-hero-pnl-card.pos::before { background: var(--success); }
.pd-hero-pnl-card.neg::before { background: var(--danger); }
.pd-hero-pnl-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.pd-hero-pnl-value { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 2px 0; }
.pd-hero-pnl-card.pos .pd-hero-pnl-value { color: var(--success); }
.pd-hero-pnl-card.neg .pd-hero-pnl-value { color: var(--danger); }
.pd-hero-pnl-sub { font-size: 12px; color: var(--text-soft); line-height: 1.4; }
.pd-hero-pnl-year {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    margin-top: 10px; padding: 8px 12px;
    background: linear-gradient(135deg, rgba(26,74,122,.08), rgba(26,74,122,.03));
    border: 1px solid rgba(26,74,122,.22);
    border-radius: var(--radius);
    font-size: 13px; color: var(--text-soft);
}
.pd-hero-pnl-year::before {
    content: ""; flex: 0 0 auto;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--pd-blue); align-self: center;
}
.pd-hero-pnl-year .pd-year-tag {
    font-weight: 800; color: var(--pd-blue); letter-spacing: .3px;
}
.pd-hero-pnl-year strong { color: var(--text); font-size: 14px; }

/* Chart.js-Container: feste Höhe, damit das Canvas sauber skaliert */
.pd-chart-box { position: relative; height: 420px; width: 100%; }
@media (max-width: 720px) { .pd-chart-box { height: 340px; } }

/* ============================================================
   MITARBEITERKOSTEN: Deckungsbeitrag-Aufschlüsselung (Hover-Popover)
   ============================================================ */
.pd-db-trigger { cursor: help; outline: none; padding-right: 18px; }
.pd-db-info {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-muted); opacity: .55; z-index: 2;
    transition: opacity .15s ease, color .15s ease;
}
.pd-db-info svg { width: 14px; height: 14px; }
.pd-db-trigger:hover .pd-db-info, .pd-db-trigger:focus .pd-db-info { opacity: 1; color: var(--pd-blue); }

.pd-db-pop {
    position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 50;
    width: 290px; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 12px 32px rgba(18,42,64,.18);
    padding: 12px 14px; text-align: left;
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.pd-db-trigger:hover .pd-db-pop, .pd-db-trigger:focus .pd-db-pop {
    opacity: 1; visibility: visible; transform: translateY(0);
}
/* kleiner Zeiger nach unten (Popover oberhalb) */
.pd-db-pop::after {
    content: ""; position: absolute; top: 100%; right: 16px;
    border: 7px solid transparent; border-top-color: #fff;
    filter: drop-shadow(0 1px 0 var(--border));
}
/* Popover unterhalb: Zeiger nach oben */
.pd-db-pop.below::after {
    top: auto; bottom: 100%;
    border-top-color: transparent; border-bottom-color: #fff;
    filter: drop-shadow(0 -1px 0 var(--border));
}
.pd-db-pop-head {
    font-size: 12px; font-weight: 700; color: var(--text);
    padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft);
}
.pd-db-pop-row {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12.5px; color: var(--text-soft); padding: 3px 0; white-space: nowrap;
}
.pd-db-pop-row > span:first-child { white-space: normal; }
.pd-db-pop-row .pos { color: var(--success); font-weight: 600; }
.pd-db-pop-row .neg { color: var(--danger); font-weight: 600; }
.pd-db-pop-hint { color: var(--text-muted); font-size: 11px; }
.pd-db-pop-sub {
    border-top: 1px dashed var(--border-soft); margin-top: 4px; padding-top: 6px;
    font-weight: 600; color: var(--text);
}
.pd-db-pop-total {
    border-top: 2px solid var(--border); margin-top: 6px; padding-top: 7px;
    font-weight: 800; font-size: 13.5px; color: var(--text);
}

/* ============================================================
   MITARBEITERKOSTEN: aufklappbare P&L-Detailtabelle
   ============================================================ */
.pd-pnl-details {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 4px 16px; margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(18,42,64,.04);
}
.pd-pnl-details > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; padding: 12px 0;
    font-size: 13px; font-weight: 600; color: var(--pd-blue);
    user-select: none;
}
.pd-pnl-details > summary::-webkit-details-marker { display: none; }
.pd-pnl-summary-label { display: inline-flex; align-items: center; gap: 8px; }
.pd-pnl-summary-label svg { width: 16px; height: 16px; }
.pd-pnl-chevron { display: inline-flex; transition: transform .2s ease; color: var(--text-muted); }
.pd-pnl-chevron svg { width: 16px; height: 16px; }
.pd-pnl-details[open] > summary .pd-pnl-chevron { transform: rotate(180deg); }
.pd-pnl-details[open] > summary { border-bottom: 1px solid var(--border-soft); }

.pd-pnl-table { font-size: 12.5px; }
.pd-pnl-table tbody tr.pd-pnl-current { background: var(--surface-2); }
.pd-pnl-table tbody tr.pd-pnl-current td:first-child { box-shadow: inset 3px 0 0 var(--pd-gold); }
.pd-pnl-details .pd-table-wrap { padding-bottom: 8px; }

/* ============================================================
   MITARBEITERKOSTEN: KPI-Karten mit Erklärungs-Tooltip
   ============================================================ */
.pd-kpi-info { position: relative; }
/* gehoverte Karte über die Nachbarn heben, damit der Tooltip nicht verdeckt wird */
.pd-kpi-info:hover { z-index: 70; }
.pd-kpi-help {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    display: inline-flex; width: 16px; height: 16px;
    color: var(--text-muted); opacity: .45; cursor: help;
    transition: opacity .15s ease, color .15s ease;
}
.pd-kpi-help svg { width: 16px; height: 16px; }
.pd-kpi-info:hover .pd-kpi-help { opacity: 1; color: var(--pd-blue); }

.pd-kpi-tip {
    position: absolute; top: calc(100% + 8px); right: -4px; z-index: 80;
    width: 260px; max-width: 80vw; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 12px 32px rgba(18,42,64,.22);
    padding: 11px 13px; font-size: 12.5px; line-height: 1.5; font-weight: 400;
    color: var(--text); text-align: left; text-transform: none; letter-spacing: normal;
    white-space: normal; word-break: normal; overflow-wrap: break-word;
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.pd-kpi-help:hover .pd-kpi-tip { opacity: 1; visibility: visible; transform: translateY(0); }
.pd-kpi-tip::after {
    content: ""; position: absolute; bottom: 100%; right: 8px;
    border: 7px solid transparent; border-bottom-color: #fff;
    filter: drop-shadow(0 -1px 0 var(--border));
}

/* ============================================================
   MITARBEITERKOSTEN: Chart + eigene HTML-Legende (linksbündig, einspaltig)
   ============================================================ */
.pd-chart-row { display: flex; gap: 20px; align-items: stretch; }
.pd-chart-row .pd-chart-box { flex: 1 1 auto; min-width: 0; }
.pd-chart-legend-v {
    flex: 0 0 270px; align-self: center;
    display: flex; flex-direction: column; gap: 4px;
    max-height: 100%; overflow-y: auto; padding: 4px 0;
}
.pd-legend-row {
    display: flex; align-items: flex-start; gap: 9px;
    background: none; border: 0; cursor: pointer;
    padding: 5px 6px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text); text-align: left; width: 100%;
    transition: background .12s ease;
}
.pd-legend-row:hover { background: var(--surface-2); }
.pd-legend-swatch { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; }
.pd-legend-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pd-legend-text { white-space: normal; overflow-wrap: anywhere; word-break: normal; line-height: 1.35; }
.pd-legend-sub { font-size: 11.5px; color: var(--text-muted); }
.pd-legend-row.is-hidden { opacity: .4; }
.pd-legend-row.is-hidden .pd-legend-text { text-decoration: line-through; }

@media (max-width: 720px) {
    .pd-chart-row { flex-direction: column; }
    .pd-chart-legend-v { flex-basis: auto; max-height: 220px; }
}

/* ============================================================
   FOTOGRAFIE-KALKULATION: Filter-Checkbox-Reihe
   ============================================================ */
.pd-checkrow {
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
    padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius); min-height: 38px;
}
.pd-checkrow .pd-check { text-transform: capitalize; }

/* ============================================================
   SEGMENTBERICHT: KPI-Untertitel
   ============================================================ */
.pd-kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   CASHOUT: Fortschrittsbalken (Budget-Auslastung)
   ============================================================ */
/* großer Balken im Auslastungs-Card (volle Breite) */
.pd-card-body > .pd-progress { width: 100%; flex: none; height: 12px; }
.pd-progress-bar.ok   { background: var(--success); }
.pd-progress-bar.warn { background: var(--warning); }
.pd-progress-bar.over { background: var(--danger); }

/* kleiner Balken in der Tabellenzelle */
.pd-mini-progress {
    width: 100%; height: 7px; background: var(--surface-3);
    border-radius: 999px; overflow: hidden; margin-bottom: 3px;
}
.pd-mini-progress-bar { height: 100%; border-radius: 999px; transition: width .3s ease; }
.pd-mini-progress-bar.ok   { background: var(--success); }
.pd-mini-progress-bar.warn { background: var(--warning); }
.pd-mini-progress-bar.over { background: var(--danger); }

/* ============================================================
   CASHOUT: Abschnitts-Trenner (Jahresübersicht)
   ============================================================ */
.pd-section-divider {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: var(--pd-blue-dark);
    padding-bottom: 8px; border-bottom: 2px solid var(--pd-gold);
}
.pd-section-divider svg { width: 20px; height: 20px; }

/* ============================================================
   FIRMENSTAMMDATEN: Formular-Grid + Logos + Erfolgs-Alert
   ============================================================ */
.pd-form-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.pd-form-grid .pd-form-row { margin: 0; }
@media (max-width: 720px) { .pd-form-grid { grid-template-columns: 1fr; } }

.pd-auth-alert--ok {
    background: var(--success-bg); color: var(--success);
    border: 1px solid var(--success);
}

.pd-logo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.pd-logo-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: var(--surface); display: flex; flex-direction: column;
}
.pd-logo-preview {
    height: 130px; display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); padding: 14px;
}
.pd-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pd-logo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); }
.pd-logo-empty svg { width: 32px; height: 32px; opacity: .5; }
.pd-logo-empty span { font-size: 12px; }
.pd-logo-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-top: 1px solid var(--border-soft); gap: 8px;
}
.pd-logo-name { font-weight: 600; font-size: 13px; }
.pd-logo-actions { display: flex; gap: 6px; }

/* ============================================================
   MITARBEITER-EFFIZIENZ: Karten-Grid
   ============================================================ */
.pd-eff-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.pd-eff-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 16px; box-shadow: var(--shadow);
}
.pd-eff-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pd-eff-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; }
.pd-eff-name svg { width: 16px; height: 16px; color: var(--text-muted); }
.pd-eff-value { font-size: 22px; font-weight: 800; }
.pd-eff-ok   { color: var(--success); }
.pd-eff-warn { color: var(--warning); }
.pd-eff-low  { color: var(--danger); }
.pd-eff-foot { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }

/* ============================================================
   PROVISIONEN: hervorgehobene Rollen-Zelle (eigene Provision)
   ============================================================ */
.pd-table td.pd-hl { background: rgba(89,161,79,.10); font-weight: 600; }

/* ============================================================
   RECHNUNGS-ÜBERSICHT: Hochrechnungs-Banner (Planumsatz)
   ============================================================ */
.pd-projection-banner {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(26,74,122,.06), rgba(26,74,122,.02));
    border: 1px solid var(--border); border-left: 4px solid var(--pd-blue);
    border-radius: var(--radius-lg); padding: 14px 18px;
    box-shadow: 0 1px 2px rgba(18,42,64,.04);
}
.pd-proj-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
    background: var(--pd-blue); color: #fff;
}
.pd-proj-ico svg { width: 20px; height: 20px; }
.pd-projection-banner > div { display: flex; flex-direction: column; }
.pd-proj-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--pd-blue); }
.pd-proj-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.15; }
.pd-proj-detail { font-size: 13px; color: var(--text-soft); margin-left: auto; text-align: right; line-height: 1.6; }
.pd-proj-detail strong { color: var(--text); }
.pd-proj-note { display: block; font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 720px) {
    .pd-proj-detail { margin-left: 0; text-align: left; width: 100%; }
}

/* ============================================================
   RECHNUNGSANSICHT (FIN_Invoice_Management)
   ============================================================ */
/* Buttons (Ergänzungen) */
.pd-btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.pd-btn-success:hover { background: #4d9244; border-color: #4d9244; }
.pd-btn-success svg { width: 15px; height: 15px; }
.pd-btn-ghost { background: transparent; border-color: var(--border); color: var(--text-soft); }
.pd-btn-ghost:hover { background: var(--surface-3); color: var(--text); }

/* KPI-Icon rot */
.pd-kpi-ico-red { background: var(--danger-bg, rgba(225,71,89,.12)); color: var(--danger); }

/* Filterleiste */
.pd-filter-card .pd-card-body { padding: 16px 18px; }
.pd-inv-filter-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pd-inv-search { position: relative; flex: 1 1 280px; }
.pd-inv-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); display: inline-flex; }
.pd-inv-search-ico svg { width: 17px; height: 17px; }
.pd-inv-search .pd-control { padding-left: 38px; }
.pd-inv-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 2px; }
.pd-inv-tab { border: none; background: transparent; padding: 7px 14px; border-radius: calc(var(--radius) - 3px); font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; transition: all .15s ease; }
.pd-inv-tab:hover { color: var(--text); }
.pd-inv-tab.active { background: var(--pd-blue); color: #fff; box-shadow: 0 1px 3px rgba(26,74,122,.3); }
.pd-inv-filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.pd-inv-field { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.pd-inv-field label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.pd-inv-field .pd-control { min-width: 0; }
.pd-inv-reset { margin-left: auto; justify-content: flex-end; }
.pd-inv-reset .pd-btn { margin-bottom: 1px; }

/* Tabelle */
.pd-table-hover tbody tr { transition: background .12s ease; }
.pd-table-hover tbody tr:hover { background: var(--surface-2); }
.pd-result-info { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.pd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-inv-link { color: var(--pd-blue); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.pd-inv-link:hover { text-decoration: underline; }
.pd-inv-ext { display: inline-flex; color: var(--text-muted); }
.pd-muted { color: var(--text-muted); }
.pd-icon-btn-ok:hover { background: var(--success-bg, rgba(89,161,79,.12)); color: var(--success); border-color: var(--success); }
a.pd-icon-btn { text-decoration: none; }

/* Sortierbare Spalten (Pfeil-Indikator) */
.pd-table th.pd-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.pd-table th.pd-sortable:hover { color: var(--pd-blue); }
.pd-table th.pd-sortable::after { content: "\2195"; opacity: .25; margin-left: 5px; font-size: 11px; }
.pd-table th.pd-sortable.sort-asc::after { content: "\2191"; opacity: .9; }
.pd-table th.pd-sortable.sort-desc::after { content: "\2193"; opacity: .9; }

/* Pager */
.pd-pager { display: flex; gap: 5px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 16px; }
.pd-pager:empty { display: none; }
.pd-pager-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.pd-pager-btn:hover:not(:disabled):not(.active) { background: var(--surface-3); color: var(--pd-blue); border-color: var(--pd-blue); }
.pd-pager-btn.active { background: var(--pd-blue); color: #fff; border-color: var(--pd-blue); }
.pd-pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pd-pager-dots { color: var(--text-muted); padding: 0 4px; }

/* Spinner */
.pd-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--pd-blue); border-radius: 50%; animation: pd-spin .7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes pd-spin { to { transform: rotate(360deg); } }

/* Detail-Grid im Modal */
.pd-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pd-detail-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.pd-detail-row:nth-child(odd) { border-right: 1px solid var(--border-soft); }
.pd-detail-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.pd-detail-val { font-size: 14px; color: var(--text); }
@media (max-width: 600px) {
    .pd-detail-grid { grid-template-columns: 1fr; }
    .pd-detail-row:nth-child(odd) { border-right: none; }
    .pd-inv-reset { margin-left: 0; }
}

/* Body-Scroll-Lock bei offenem Modal */
body.pd-modal-open { overflow: hidden; }

/* ============================================================
   RECHNUNGS-ÜBERSICHT: Mehrjahres-Prognose (Folgejahre)
   ============================================================ */
.pd-forecast-row {
    display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    box-shadow: 0 1px 2px rgba(18,42,64,.04);
}
.pd-forecast-card {
    flex: 1 1 180px; display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px; border-radius: var(--radius);
    border: 1px solid var(--border-soft); background: var(--surface-2);
    position: relative;
}
.pd-forecast-card.current { border-color: rgba(26,74,122,.3); background: linear-gradient(135deg, rgba(26,74,122,.07), rgba(26,74,122,.02)); }
.pd-forecast-card.future { border-color: rgba(63,142,136,.4); background: linear-gradient(135deg, rgba(118,183,178,.12), rgba(118,183,178,.03)); }
.pd-forecast-year { font-size: 13px; font-weight: 800; color: var(--text); letter-spacing: .3px; }
.pd-forecast-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.pd-forecast-card.current .pd-forecast-tag { color: var(--pd-blue); }
.pd-forecast-card.future .pd-forecast-tag { color: #3f8e88; }
.pd-forecast-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.15; margin-top: 4px; }
.pd-forecast-sub { font-size: 12px; color: var(--text-soft); }
.pd-forecast-arrow { display: flex; align-items: center; color: var(--text-muted); flex: 0 0 auto; }
.pd-forecast-arrow svg { width: 22px; height: 22px; }
.pd-forecast-note {
    flex: 1 1 100%; display: flex; align-items: flex-start; gap: 8px;
    margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--border);
    font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
}
.pd-forecast-note svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
@media (max-width: 720px) {
    .pd-forecast-arrow { display: none; }
    .pd-forecast-card { flex: 1 1 100%; }
}

/* ============================================================
   BELEGERFASSUNG: ausgewählte Datei als Chip (statt nativer File-Input)
   ============================================================ */
.pd-file-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface-2);
    margin-top: 4px;
}
.pd-file-chip-ico { display: inline-flex; color: var(--pd-blue); flex: 0 0 auto; }
.pd-file-chip-ico svg { width: 22px; height: 22px; }
.pd-file-chip-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file-chip-size { font-size: 12px; color: var(--text-muted); flex: 0 0 auto; }
.pd-file-chip-remove {
    margin-left: auto; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    color: var(--text-muted); cursor: pointer; transition: all .15s ease;
}
.pd-file-chip-remove:hover { background: var(--danger-bg, rgba(225,71,89,.12)); color: var(--danger); border-color: var(--danger); }
.pd-file-chip-remove svg { width: 16px; height: 16px; }

/* ============================================================
   RECHNUNGSANSICHT: Erfolgs-Modal nach Versand/Mahnung/Bezahlt
   ============================================================ */
.pd-modal-success { position: relative; }
.pd-modal-success .pd-modal-close { position: absolute; top: 12px; right: 12px; }
.pd-success-ring {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--success-bg, rgba(89,161,79,.14)); color: var(--success);
    margin-bottom: 14px;
    animation: pd-success-pop .35s cubic-bezier(.34,1.56,.64,1);
}
.pd-success-ring svg { width: 36px; height: 36px; }
.pd-success-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--text); }
.pd-success-text { margin: 0 auto; max-width: 340px; font-size: 14px; color: var(--text-soft); line-height: 1.5; }
@keyframes pd-success-pop {
    0% { transform: scale(.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   RECHNUNG ERSTELLEN: kompakte Tabellen-Inputs, Entfernen-Button, Seiten-Untertitel
   ============================================================ */
.pd-page-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-soft); }
.pd-input-sm { padding: 6px 8px; font-size: 13px; margin: 0; }
textarea.pd-input-sm { resize: vertical; min-height: 38px; }
.pd-icon-btn-danger { color: var(--text-muted); }
.pd-icon-btn-danger:hover { background: var(--danger-bg, rgba(225,71,89,.12)); color: var(--danger); border-color: var(--danger); }
#linesTable td { vertical-align: top; }

/* ============================================================
   RECHNUNGSANSICHT: Storno-/Lösch-Aktionen
   ============================================================ */
.pd-page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-btn-danger-soft {
    background: var(--danger-bg, rgba(225,71,89,.10));
    color: var(--danger);
    border-color: var(--danger-bg, rgba(225,71,89,.25));
}
.pd-btn-danger-soft:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ============================================================
   BANKIMPORT: Zeilen-Status in der Vorschau
   ============================================================ */
.pd-table tr.pd-row-error td { background: var(--danger-bg, rgba(225,71,89,.06)); }
.pd-table tr.pd-row-muted td { color: var(--text-muted); background: var(--surface-2); }
.pd-table tr.pd-row-muted .pd-muted { color: var(--text-muted); }
