:root { --main-color: #004d4d; --accent-color: #4a90e2; --bg-color: #f8f9fa; --text-dark: #333; --text-light: #666; --border: #e0e0e0; }
        body { font-family: 'Segoe UI', sans-serif; margin: 0; display: flex; background: var(--bg-color); color: var(--text-dark); }
        
        nav { width: 240px; background: white; height: 100vh; border-right: 1px solid var(--border); position: fixed; display: flex; flex-direction: column; z-index: 100; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
        .nav-footer { position: relative; margin-top: auto; border-top: 1px solid var(--border); padding: 10px 12px; background: #fafbfc; }
        .nav-user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 8px; padding: 6px; width: 100%; box-sizing: border-box; }
        .nav-user-chip:hover { background: #f0f2f5; }
        .nav-user-chevron { color: #9ca3af; font-size: 14px; line-height: 1; margin-left: 2px; flex-shrink: 0; }
        #nav-user-display-name { color: #c2410c; }
        #nav-user-context { color: #ea580c; opacity: 0.85; }
        .nav-user-menu {
            position: fixed;
            z-index: 2000;
            min-width: 240px;
            max-width: min(320px, calc(100vw - 16px));
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
            padding: 6px 0;
            display: none;
        }
        .nav-user-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            text-align: left;
            border: none;
            background: transparent;
            font: inherit;
            font-size: 14px;
            color: #111;
            padding: 10px 16px;
            cursor: pointer;
        }
        .nav-user-menu-item:hover { background: #f3f4f6; }
        .nav-user-menu-ic { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.6; }
        .nav-user-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #4b5563; flex-shrink: 0; }
        .nav-user-av.has-img { font-size: 0; }
        /* Jibble-style Stempelleiste: volle Breite neben Nav, heller Rand */
        .jibble-app-top {
            position: fixed;
            top: 0;
            left: 240px;
            right: 0;
            z-index: 1500;
            display: none;
            align-items: center;
            justify-content: flex-end;
            flex-wrap: nowrap;
            gap: 8px;
            min-height: 44px;
            padding: 6px 16px 6px 20px;
            background: #ffffff;
            border-top: 1px solid #dbe3ec;
            border-bottom: 1px solid #e8edf3;
            box-sizing: border-box;
        }
        .jibble-app-imp-blk {
            display: none;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-right: auto;
        }
        .jibble-app-imp-blk .impersonation-badge { display: inline-block; }
        .jibble-app-imp-blk button { border: 1px solid #d1d5db; background: #fff; border-radius: 10px; font-size: 12px; padding: 6px 12px; cursor: pointer; }
        .jibble-timer-cluster {
            display: none;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            gap: 10px;
            flex: 0 0 auto;
        }
        .sys-health-wrap { position: relative; margin-left: 10px; flex: 0 0 auto; }
        .sys-health-trigger {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: 1px solid #d8dee7;
            border-radius: 999px;
            background: #fff;
            padding: 6px 10px 6px 12px;
            cursor: pointer;
            user-select: none;
        }
        .sys-health-trigger:hover { background: #f7f9fc; }
        .sys-health-text {
            font-size: 12px;
            color: #334155;
            max-width: 240px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .sys-health-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
            border: 1px solid transparent;
            box-shadow: 0 0 0 rgba(0, 0, 0, 0);
        }
        .sys-health-dot.green { background: #22c55e; border-color: #16a34a; box-shadow: 0 0 10px rgba(34,197,94,.45); }
        .sys-health-dot.yellow { background: #f59e0b; border-color: #d97706; box-shadow: 0 0 10px rgba(245,158,11,.45); }
        .sys-health-dot.red { background: #ef4444; border-color: #dc2626; box-shadow: 0 0 10px rgba(239,68,68,.45); }
        .sys-health-dot.unknown { background: #94a3b8; border-color: #64748b; }
        .sys-health-panel {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            width: min(460px, calc(100vw - 280px));
            background: #fff;
            border: 1px solid #d8dee7;
            border-radius: 10px;
            box-shadow: 0 12px 36px rgba(0,0,0,.16);
            padding: 12px;
            z-index: 2100;
            display: none;
        }
        .sys-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
        .sys-health-head strong { font-size: 13px; }
        .sys-health-meta { font-size: 11px; color: #64748b; }
        .sys-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
        .sys-health-kpi { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; }
        .sys-health-kpi .k { font-size: 11px; color: #64748b; display: block; }
        .sys-health-kpi .v { font-size: 18px; font-weight: 700; color: #111827; line-height: 1.2; }
        .sys-health-section-label { font-size: 11px; color: #64748b; margin: 10px 0 4px; }
        .sys-health-section-label:first-of-type { margin-top: 0; }
        .sys-health-apps { padding-top: 0; }
        .sys-health-apps-host { margin: 4px 0 0; }
        .sys-health-kpis-inline { margin: 8px 0 4px; }
        #sys-health-one-kpis { margin-bottom: 4px; }
        .sys-health-tactical-app { border-top: 1px solid #eef2f7; margin-top: 8px; padding-top: 4px; }
        .sys-health-app-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12px; }
        .sys-health-app-main { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
        .sys-health-app-name { color: #0f172a; font-weight: 600; }
        .sys-health-app-detail { color: #64748b; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .sys-health-app-ms { color: #64748b; white-space: nowrap; }
        .jibble-timer-dock-timer {
            font-size: 18px;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.02em;
            color: #111827;
            min-width: 78px;
            line-height: 1.2;
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
        }
        .jibble-timer-dock-timer.jibble-timer-muted { color: #9ca3af; }
        .jibble-timer-dock-timer.jibble-timer-amber { color: #b45309; }
        .jibble-dock-btns { display: flex; align-items: center; gap: 8px; }
        .jibble-dock-btn {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: none;
            transition: filter 0.12s ease, transform 0.05s ease;
        }
        .jibble-dock-btn:hover:not(:disabled) { filter: brightness(0.92); }
        .jibble-dock-btn:active:not(:disabled) { transform: scale(0.96); }
        .jibble-dock-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .jibble-dock-green { background: #3d9144; }
        .jibble-dock-amber { background: #c9a321; }
        .jibble-dock-red { background: #a32a2a; }
        /* Ampel-Widget Monatskontingent */
        .quota-widget { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
        .quota-widget .quota-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
        .quota-widget .quota-title { font-size: 15px; font-weight: 700; margin: 0; }
        /* Traffic-Light (echte Ampel) */
        .tl-housing { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; background: #374151; border-radius: 8px; padding: 8px 7px; border: 2px solid #1f2937; flex-shrink: 0; }
        .tl-lamp { width: 26px; height: 26px; border-radius: 50%; background: #111827; border: 2px solid #4b5563; transition: background 0.3s, box-shadow 0.3s; }
        .tl-lamp.on-red    { background: #ef4444; box-shadow: 0 0 10px #ef4444, 0 0 22px rgba(239,68,68,.45); border-color: #dc2626; }
        .tl-lamp.on-yellow { background: #f59e0b; box-shadow: 0 0 10px #f59e0b, 0 0 22px rgba(245,158,11,.45); border-color: #d97706; }
        .tl-lamp.on-green  { background: #22c55e; box-shadow: 0 0 10px #22c55e, 0 0 22px rgba(34,197,94,.45);  border-color: #16a34a; }
        /* Kompakte Ampel (inline neben Text) */
        .tl-housing-sm { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; background: #374151; border-radius: 5px; padding: 4px 4px; border: 1.5px solid #1f2937; flex-shrink: 0; vertical-align: middle; }
        .tl-lamp-sm { width: 9px; height: 9px; border-radius: 50%; background: #1f2937; border: 1.5px solid #4b5563; transition: background 0.25s, box-shadow 0.25s; }
        .tl-lamp-sm.on-red    { background: #ef4444; box-shadow: 0 0 5px #ef4444, 0 0 10px rgba(239,68,68,.5); border-color: #dc2626; }
        .tl-lamp-sm.on-yellow { background: #f59e0b; box-shadow: 0 0 5px #f59e0b, 0 0 10px rgba(245,158,11,.5); border-color: #d97706; }
        .tl-lamp-sm.on-green  { background: #22c55e; box-shadow: 0 0 5px #22c55e, 0 0 10px rgba(34,197,94,.5);  border-color: #16a34a; }
        /* Accordion Buchungen */
        .time-day-row { cursor: pointer; background: #f8fafc; font-weight: 600; }
        .time-day-row:hover { background: #f1f5f9; }
        .time-day-expand { display: inline-block; width: 14px; font-size: 11px; color: #64748b; transition: transform 0.15s; }
        .time-day-child td { background: #fff; font-weight: 400; border-left: 3px solid #e2e8f0; }
        .time-day-child td:first-child { padding-left: 28px; color: #64748b; font-size: 13px; }
        .time-entry-deleted td { text-decoration: line-through; color: #94a3b8 !important; opacity: 0.75; }
        .time-entry-deleted td:first-child { color: #c0392b !important; }
        .time-del-form-row td { background: #fff8f8 !important; border-left: 3px solid #fca5a5 !important; padding: 6px 12px 8px 28px !important; text-decoration: none !important; }
        .time-del-note-input { padding: 4px 8px; border: 1px solid #fca5a5; border-radius: 4px; font-size: 13px; width: 280px; }
        .btn-danger { background: #ef4444; color: #fff; border: none; }
        .btn-danger:hover { background: #dc2626; }        /* Quota-Infoleiste */
        .quota-bar-track { height: 12px; background: #f1f5f9; border-radius: 99px; overflow: hidden; margin: 8px 0; }
        .quota-bar-fill  { height: 100%; border-radius: 99px; transition: width 0.4s; }
        .quota-bar-fill.green  { background: #22c55e; }
        .quota-bar-fill.yellow { background: #f59e0b; }
        .quota-bar-fill.red    { background: #ef4444; }
        .quota-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; align-items: flex-end; }
        .quota-stat  { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
        .quota-stat .qs-val  { font-size: 20px; font-weight: 700; color: #1e293b; }
        .quota-stat .qs-lbl  { font-size: 12px; color: #64748b; }
        .quota-settlement-row { display: flex; justify-content: flex-end; margin-top: 12px; }
        .quota-settlement-note-wrap { width: min(100%, 380px); }
        .quota-settlement-note-wrap label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
        .quota-settlement-note-wrap textarea {
            width: 100%; box-sizing: border-box; min-height: 58px; padding: 8px 10px;
            border: 1px solid var(--border); border-radius: 6px; font-size: 13px; line-height: 1.4; resize: vertical;
        }
        .quota-settlement-note-wrap textarea:disabled { background: #f1f5f9; color: #64748b; cursor: not-allowed; }
        .quota-settlement-note-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
        .quota-settlement-locked-hint { margin: 4px 0 0; font-size: 11px; color: #94a3b8; }
        /* Wage-Section im Staff-Modal */
        .wage-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
        .wage-section h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
        .wage-history-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
        .wage-history-table th, .wage-history-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
        .wage-history-table th { color: #64748b; font-weight: 600; }
        .wage-history-table td:last-child { text-align: right; }
        .jibble-dock-btn .jibble-svg-ic { display: block; }
        .jibble-resume-pill {
            display: inline-flex;
            align-items: center;
            padding: 5px 12px;
            border-radius: 999px;
            border: 1px solid #d1d5db;
            background: #f3f4f6;
            color: #4b5563;
            font-weight: 500;
            font-size: 12px;
            cursor: pointer;
        }
        .jibble-resume-pill:hover { background: #e5e7eb; }
        .jibble-ic-activity { width: 16px; height: 16px; fill: currentColor; }
        .logo { padding: 16px 12px; background: #fff; margin-bottom: 10px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
        .logo img { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; object-fit: contain; background: transparent; }
        .logo .branding-logo-fallback { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--text-dark); text-align: center; letter-spacing: 0.02em; }
        .nav-item { padding: 12px 20px; cursor: pointer; color: var(--text-dark); display: block; font-weight: 500; }
        a.nav-item { text-decoration: none; box-sizing: border-box; }
        .nav-item:hover { background: #f0f0f0; }
        
        .dropdown { position: relative; }
        .dropdown-content {
            display: none;
            background: #fafafa;
            border-left: 3px solid var(--accent-color);
        }
        .dropdown.is-open .dropdown-content { display: block; animation: nav-dd-in 0.14s ease-out; }
        @keyframes nav-dd-in { from { opacity: 0.6; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
        .dropdown-item { padding: 10px 20px 10px 40px; display: block; color: var(--text-light); font-size: 14px; cursor: pointer; }
        .dropdown-item:hover { color: var(--main-color); font-weight: bold; background: #eee; }
        .nav-sub-menu { display: none; }
        .nav-sub-menu.open { display: block; }
        .dropdown-item.nav-sub-item {
            padding: 8px 20px 8px 52px;
            font-size: 13px;
        }
        .dropdown-item.nav-sub-item.active {
            color: var(--main-color);
            font-weight: 700;
            background: #eee;
        }
        .menu-header { padding: 15px 20px 5px 40px; font-size: 11px; text-transform: uppercase; color: #aaa; letter-spacing: 1px; }

        main { margin-left: 240px; flex-grow: 1; padding: 58px 40px 40px 40px; }
        .view { display: none; }
        .view.active { display: block; }

        .view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
        .view-header h1 { margin: 0; font-weight: 500; font-size: 24px; }
        
        .btn-group { display: flex; gap: 10px; }
        .btn { padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; border: 1px solid var(--border); background: white; color: var(--text-dark); }
        .btn-primary { background: #3b3b6d; color: white; border: none; }
        
        .tab-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 10px; }
        .tabs { display: flex; gap: 20px; }
        .tab { color: #888; font-weight: 500; cursor: pointer; padding-bottom: 10px; margin-bottom: -11px; }
        .tab.active { color: var(--text-dark); border-bottom: 2px solid #e74c3c; }


        .invoice-bank-summary strong { display: block; font-size: 14px; color: #111827; margin-top: 2px; }
        .beleg-pay-doc-card {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            padding: 16px 20px;
            margin-bottom: 18px;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            background: #fafafa;
        }
        .beleg-pay-doc-meta { min-width: 0; flex: 1; }
        .beleg-pay-doc-nr { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 4px; }
        .beleg-pay-doc-party { font-size: 14px; color: #374151; margin-bottom: 2px; }
        .beleg-pay-doc-date { font-size: 13px; color: #6b7280; }
        .beleg-pay-doc-amount { text-align: right; flex-shrink: 0; }
        .beleg-pay-doc-amount strong { display: block; font-size: 22px; font-weight: 700; color: #111827; line-height: 1.2; }
        .beleg-pay-doc-amount span { font-size: 12px; color: #6b7280; }
        .beleg-pay-section-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #111827; }
        .beleg-pay-account-row { margin-bottom: 12px; }
        .beleg-pay-account-row select { width: 100%; }
        .beleg-pay-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
        .beleg-pay-search-row input { flex: 1; }
        .beleg-pay-account-hint {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 8px;
        }
        .beleg-pay-tx-list { flex: 1; min-height: 180px; max-height: 320px; overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
        .beleg-pay-tx-list table { width: 100%; }
        .beleg-pay-tx-list tr { cursor: pointer; }
        .beleg-pay-tx-list tr.selected { background: #f0f4ff; }
        .beleg-pay-tx-list td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
        .beleg-pay-tx-list th { padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; text-align: left; border-bottom: 1px solid #e5e7eb; background: #f9fafb; }
        .beleg-pay-selection-summary { margin-top: 10px; font-size: 13px; color: #374151; }
        #beleg-bank-assign-hint.err { color: #b91c1c; font-weight: 500; }
        .beleg-pay-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
        .beleg-pay-dialog .bank-transfer-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
        .bank-page-head { margin-bottom: 4px; }
        .bank-page-head h1 { margin: 0; font-weight: 500; font-size: 24px; }
        .bank-tab-bar { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--border); margin-bottom: 0; padding-bottom: 0; flex-wrap: wrap; gap: 12px; }
        .bank-tab-bar .tabs { gap: 24px; flex-wrap: wrap; }
        .bank-tab-bar .tab { font-size: 14px; padding-bottom: 12px; margin-bottom: -1px; white-space: nowrap; }
        .bank-toolbar { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; flex-wrap: wrap; }
        .bank-toolbar .inv-head-btn { font-size: 13px; padding: 7px 14px; }
        .bank-toolbar .search-input { width: 200px; font-size: 13px; }
        .bank-tx-name-wrap { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
        .bank-tx-name-text {
            min-width: 0;
            flex: 1;
            font-weight: 500;
            color: #111827;
            line-height: 1.35;
            white-space: normal;
            word-break: break-word;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .bank-tx-name-text.expanded { -webkit-line-clamp: 3; }
        .bank-purpose-cell { width: 34%; max-width: 360px; }
        .inv-table-wrap.bank-table-wrap {
            overflow-x: hidden;
            max-width: 100%;
        }
        table.bank-tx-table.acct-paginated-table {
            min-width: 0;
            width: 100%;
            table-layout: fixed;
        }
        table.bank-tx-table.acct-paginated-table thead th,
        table.bank-tx-table.acct-paginated-table tbody td {
            padding: 10px 8px;
            font-size: 12px;
        }
        table.bank-tx-table col.col-w-bank-status { width: 108px; }
        table.bank-tx-table col.col-w-bank-source { width: 72px; }
        table.bank-tx-table:not(.bank-show-source-col) .bank-archiv-col,
        table.bank-tx-table:not(.bank-show-source-col) .bank-tx-source-cell { display: none; }
        table.bank-tx-table col.col-w-bank-name { width: 14%; }
        table.bank-tx-table col.col-w-bank-purpose { width: 22%; }
        table.bank-tx-table col.col-w-date-sm { width: 9%; }
        table.bank-tx-table col.col-w-money-sm { width: 9%; }
        table.bank-tx-table col.col-w-money-xs { width: 8%; }
        table.bank-tx-table col.col-w-bank-link { width: 15%; }
        table.bank-tx-table col.col-w-bank-actions { width: 92px; }
        table.bank-tx-table td.bank-purpose-cell {
            max-width: none;
            width: auto;
        }
        table.bank-tx-table td.bank-tx-status-cell {
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
            padding-left: 6px;
            padding-right: 4px;
        }
        table.bank-tx-table td.bank-tx-link-cell {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        table.bank-tx-table td.bank-tx-status-cell .status {
            font-size: 11px;
            padding: 3px 7px;
            max-width: none;
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
            vertical-align: middle;
        }
        table.bank-tx-table td.bank-tx-link-cell .bank-link-ref {
            display: block;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        table.bank-tx-table td.bank-amt-pos,
        table.bank-tx-table td.bank-amt-neg {
            text-align: right;
        }
        table.bank-tx-table .bank-row-actions {
            min-width: 0;
            gap: 2px;
        }
        .bank-purpose-wrap { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
        .bank-purpose-text {
            min-width: 0;
            flex: 1;
            color: #4b5563;
            line-height: 1.35;
            white-space: normal;
            word-break: break-word;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .bank-purpose-text.expanded { -webkit-line-clamp: 3; }
        .bank-purpose-toggle {
            border: none;
            background: none;
            color: #6b7280;
            cursor: pointer;
            padding: 0 2px;
            font-size: 16px;
            line-height: 1;
            margin-top: 1px;
            flex-shrink: 0;
        }
        .bank-purpose-toggle:hover { color: #111827; }
        .bank-amt-pos { color: #16a34a; font-weight: 500; }
        .bank-amt-neg { color: #dc2626; font-weight: 500; }
        .bank-link-ref { color: #5d82d1; font-size: 13px; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
        .bank-link-ref:hover { text-decoration: underline; }
        .bank-assign-dialog.bank-linked-docs-dialog {
            width: min(500px, calc(100vw - 24px));
            max-width: min(500px, calc(100vw - 24px));
            max-height: calc(100vh - 32px);
            display: flex;
            flex-direction: column;
        }
        .bank-assign-dialog.bank-linked-docs-dialog .bank-transfer-head { padding: 14px 16px; }
        .bank-assign-dialog.bank-linked-docs-dialog .bank-transfer-head h2 { font-size: 17px; }
        .bank-assign-dialog.bank-linked-docs-dialog .bank-transfer-body { padding: 12px 16px 14px; }
        .bank-assign-dialog.bank-linked-docs-dialog .bank-assign-foot { padding-top: 12px; margin-top: 12px; }
        .bank-linked-docs-intro {
            margin: 0 0 10px;
            font-size: 12px;
            color: #6b7280;
            line-height: 1.45;
        }
        .bank-linked-docs-section-title {
            margin: 0 0 6px;
            font-size: 13px;
            font-weight: 600;
            color: #111827;
        }
        .bank-linked-docs-list {
            flex: 1;
            min-height: 120px;
            max-height: min(52vh, 520px);
            overflow-y: auto;
            padding-right: 2px;
        }
        .bank-linked-doc-select-all {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 2px 0 8px 10px;
            margin: 0;
            font-size: 13px;
            color: #374151;
            cursor: pointer;
        }
        .bank-linked-doc-select-all input[type="checkbox"] {
            width: 16px;
            height: 16px;
            margin: 0;
            flex-shrink: 0;
            cursor: pointer;
        }
        .bank-linked-docs-items {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }
        .bank-linked-doc-item {
            display: flex;
            align-items: stretch;
            gap: 10px;
            width: 100%;
            box-sizing: border-box;
            padding: 0 0 0 10px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #fff;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
            overflow: hidden;
        }
        .bank-linked-doc-aside {
            display: flex;
            align-items: stretch;
            flex-shrink: 0;
            margin-left: auto;
        }
        .bank-linked-doc-check {
            display: flex;
            align-items: flex-start;
            padding-top: 10px;
        }
        .bank-linked-doc-check input[type="checkbox"] {
            width: 16px;
            height: 16px;
            margin: 0;
            cursor: pointer;
        }
        .bank-linked-doc-meta { flex: 1 1 auto; min-width: 0; padding: 8px 0; cursor: pointer; }
        .bank-linked-doc-meta:hover .doc-title { color: #5d82d1; }
        .bank-linked-doc-meta .doc-title {
            font-size: 13px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 1px;
        }
        .bank-linked-doc-meta .doc-sub {
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 2px;
        }
        .bank-linked-doc-meta .doc-amt {
            font-size: 12px;
            font-weight: 600;
            color: #e11d73;
            margin-bottom: 1px;
        }
        .bank-linked-doc-meta .doc-date {
            font-size: 12px;
            color: #6b7280;
        }
        .bank-linked-doc-thumb {
            width: 40px;
            border: none;
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            align-self: center;
            flex-shrink: 0;
        }
        .bank-linked-doc-thumb svg { width: 22px; height: 28px; color: #cbd5e1; }
        .bank-linked-doc-view-col {
            display: flex;
            align-items: center;
            justify-content: center;
            align-self: stretch;
            width: 36px;
            background: #f3f4f6;
            border: none;
            border-left: 1px solid #e5e7eb;
            border-radius: 0 7px 7px 0;
            margin: 0;
            padding: 0;
            cursor: pointer;
            color: #6b7280;
            flex-shrink: 0;
        }
        .bank-linked-doc-view-col:hover { background: #e5e7eb; color: #374151; }
        .bank-linked-doc-view-col svg { width: 16px; height: 16px; }
        #bank-import-status {
            font-size: 13px;
            line-height: 1.25;
            min-height: 1.25em;
            margin: 8px 0 12px;
            overflow: hidden;
        }
        .bank-import-hint { font-size: 13px; color: #64748b; }
        .bank-import-hint.err { color: #b91c1c; }
        .bank-import-hint.ok { color: #15803d; }
        .bank-filter-panel {
            display: none;
            background: #f3f4f6;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 14px 16px;
            margin: 12px 0 16px;
        }
        .bank-filter-panel.open { display: block; }
        .bank-filter-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(140px, 1fr));
            gap: 12px 16px;
            align-items: end;
        }
        .bank-filter-grid label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
        .bank-filter-grid input, .bank-filter-grid select {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-family: inherit;
            font-size: 14px;
            box-sizing: border-box;
        }
        .bank-filter-foot { margin-top: 10px; text-align: right; }
        .bank-filter-reset { background: none; border: none; color: #5d82d1; cursor: pointer; font-size: 13px; }
        .bank-transfer-modal {
            position: fixed; inset: 0; z-index: 5000;
            display: none; align-items: center; justify-content: center;
            background: rgba(15, 23, 42, 0.45);
        }
        .bank-transfer-modal.open { display: flex; }
        .bank-assign-dialog {
            background: #fff; border-radius: 12px; width: min(960px, calc(100vw - 32px));
            max-height: calc(100vh - 32px);
            display: flex; flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
        }
        .bank-assign-dialog .bank-transfer-body {
            flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
            overflow-y: auto;
        }
        .bank-assign-tx-card {
            border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
            background: #fafbfc;
        }
        .bank-assign-tx-card h4 { margin: 0 0 8px; font-size: 13px; color: #6b7280; font-weight: 600; }
        .bank-assign-tx-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
        .bank-assign-tx-row strong { font-size: 16px; color: #111827; }
        .bank-assign-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
        .bank-assign-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
        .bank-assign-tabs .tab { padding: 8px 14px; font-size: 13px; }
        .bank-assign-search { flex: 1; min-width: 180px; position: relative; }
        .bank-assign-search input { width: 100%; padding: 8px 10px 8px 34px; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; }
        .bank-assign-search .beleg-search-icon { left: 10px; }
        .bank-assign-table-wrap {
            border: 1px solid #e5e7eb; border-radius: 8px;
            flex: 1; min-height: 300px; max-height: none; overflow: auto;
        }
        .bank-assign-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .bank-assign-table th { text-align: left; padding: 10px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-weight: 600; color: #374151; position: sticky; top: 0; }
        .bank-assign-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
        .bank-assign-table tr { cursor: pointer; }
        .bank-assign-table tr:hover { background: #f8fafc; }
        .bank-assign-table tr.selected { background: #eff6ff; }
        .bank-assign-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid #eef2f7; margin-top: 14px; flex-wrap: wrap; flex-shrink: 0; }
        .bank-assign-foot-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
        .bank-assign-foot-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: auto; }
        .bank-assign-dialog .bank-transfer-head { flex-shrink: 0; }
        #invoice-bank-assign-modal .bank-transfer-body {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #invoice-bank-assign-modal .invoice-bank-assign-main {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #invoice-bank-assign-modal #invoice-bank-assign-bank-panel,
        #invoice-bank-assign-modal #invoice-bank-assign-credit-panel {
            flex: 1 1 auto;
            min-height: 0;
            flex-direction: column;
            overflow: hidden;
        }
        #invoice-bank-assign-modal .bank-assign-table-wrap {
            min-height: 120px;
        }
        #invoice-bank-assign-modal .bank-assign-foot {
            flex-shrink: 0;
            background: #fff;
            z-index: 2;
        }
        #bank-tx-rows tr.bank-tx-clickable { cursor: pointer; }

        .exporte-page-head { margin-bottom: 20px; }
        .exporte-page-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
        .exporte-page-head p { margin: 0; color: #4b5563; font-size: 15px; }
        .exporte-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
        .exporte-card-head { background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff; padding: 18px 20px; }
        .exporte-card-head h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
        .exporte-card-head p { margin: 0; font-size: 13px; opacity: 0.92; line-height: 1.45; }
        .exporte-card-body { padding: 20px; }
        .exporte-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
        .exporte-controls label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
        .exporte-controls select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 120px; }
        .exporte-files-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; }
        .exporte-files-box h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: #111827; }
        .exporte-files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 20px; }
        .exporte-file-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #374151; }
        .exporte-file-item code { font-size: 12px; color: #1e40af; white-space: nowrap; }
        .exporte-files-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e5e7eb; font-size: 12px; color: #64748b; line-height: 1.5; }
        .exporte-banner { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 13px; color: #78350f; line-height: 1.5; }
        .exporte-banner-icon { flex-shrink: 0; font-size: 18px; line-height: 1.2; }
        .exporte-status { font-size: 13px; margin-top: 8px; min-height: 18px; }
        .exporte-status.err { color: #b91c1c; }
        .exporte-status.ok { color: #15803d; }
        .exporte-list-section { margin-top: 24px; }
        .exporte-list-section h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
        .exporte-list-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
        .exporte-list-table th { text-align: left; padding: 10px 14px; background: #f9fafb; font-size: 12px; color: #6b7280; border-bottom: 1px solid #e5e7eb; }
        .exporte-list-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: middle; }
        .exporte-list-table tr:last-child td { border-bottom: none; }
        .exporte-dl-btn { font-size: 13px; color: #2563eb; background: none; border: none; cursor: pointer; padding: 0; font-weight: 500; }
        .exporte-dl-btn:hover { text-decoration: underline; }
        .ustva-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
        .ustva-page-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
        .ustva-zahllast { font-size: 15px; color: #374151; }
        .ustva-zahllast strong { font-size: 18px; color: #111827; }
        .ustva-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
        .ustva-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
        .ustva-filters label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
        .ustva-filters select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 140px; }
        .ustva-quarter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
        .ustva-quarter-tabs .tab {
            display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
            min-width: 132px; padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 8px;
            cursor: pointer; font-size: 13px; background: #fff; box-sizing: border-box;
        }
        .ustva-quarter-tabs .tab.active { border-color: #312e81; background: #f5f3ff; color: #312e81; font-weight: 600; }
        .ustva-quarter-tabs .tab.is-submitted .ustva-tab-label { font-weight: inherit; }
        .ustva-tab-check {
            display: inline-block;
            width: 14px; height: 14px; min-width: 14px; flex-shrink: 0;
            visibility: hidden; box-sizing: border-box;
            background: transparent center / 14px 14px no-repeat;
        }
        .ustva-quarter-tabs .tab.is-submitted .ustva-tab-check {
            visibility: visible;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%239ca3af' stroke-width='1'/%3E%3Cpath d='M5 8.2 7.1 10.3 11 6.4' stroke='%236b7280' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        }
        .ustva-quarter-tabs .tab.is-submitted.active .ustva-tab-check {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%23818cf8' stroke-width='1'/%3E%3Cpath d='M5 8.2 7.1 10.3 11 6.4' stroke='%234f46e5' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        }
        .ustva-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
        .ustva-table th { text-align: left; padding: 12px 14px; background: #f9fafb; font-size: 13px; color: #374151; border-bottom: 1px solid #e5e7eb; }
        .ustva-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: top; }
        .ustva-table tr.ustva-row-parent td { font-weight: 600; background: #fafbfc; }
        .ustva-table tr.ustva-row-sub td { color: #4b5563; font-size: 13px; }
        .ustva-table tr.ustva-row-sub.ustva-row-clickable { cursor: pointer; }
        .ustva-table tr.ustva-row-sub.ustva-row-clickable:hover td { background: #f9fafb; }
        .ustva-table tr.ustva-row-sub.collapsed { display: none; }
        .ustva-table tr.ustva-row-total td { font-weight: 700; background: #f8fafc; }
        .ustva-table tr.ustva-row-clickable { cursor: pointer; }
        .ustva-table tr.ustva-row-clickable:hover td { background: #f3f4f6; }
        .ustva-desc-cell { max-width: 420px; }
        .ustva-chevron {
            display: inline-flex; align-items: center; justify-content: center;
            width: 22px; height: 22px; margin-right: 6px; border: none; background: transparent;
            color: #6b7280; cursor: pointer; font-size: 16px; line-height: 1; vertical-align: middle;
            transition: transform 0.15s ease;
        }
        .ustva-chevron.expanded { transform: rotate(90deg); }
        .ustva-detail-dialog {
            background: #fff; border-radius: 12px; width: min(640px, calc(100vw - 32px));
            max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden;
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
        }
        .ustva-detail-summary {
            display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
            padding: 14px 16px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
        }
        .ustva-detail-summary strong { display: block; font-size: 20px; color: #111827; margin-top: 4px; }
        .ustva-detail-summary span { font-size: 12px; color: #6b7280; }
        .ustva-detail-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
        .ustva-detail-item {
            display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
            border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
        }
        .ustva-detail-item-icon { font-size: 18px; line-height: 1; margin-top: 2px; }
        .ustva-detail-item-body { flex: 1; min-width: 0; }
        .ustva-detail-item-title { font-weight: 600; color: #111827; margin-bottom: 2px; }
        .ustva-detail-item-meta { font-size: 12px; color: #6b7280; }
        .ustva-detail-item-amt { text-align: right; white-space: nowrap; font-weight: 600; color: #111827; }
        .ustva-detail-item-date { font-size: 12px; color: #6b7280; margin-top: 4px; }
        .ustva-send-dialog { background: #fff; border-radius: 12px; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
        .ustva-send-dialog .bank-transfer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 22px 12px; }
        .ustva-send-dialog .bank-assign-foot {
            padding: 16px 22px 22px;
            margin-top: 0;
            border-top: 1px solid #e5e7eb;
        }
        .ustva-send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        @media (max-width: 860px) { .ustva-send-grid { grid-template-columns: 1fr; } }
        .eur-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
        .eur-page-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
        .eur-profit-line { font-size: 15px; color: #374151; }
        .eur-profit-line strong { font-size: 18px; color: #111827; }
        .eur-toolbar {
            display: flex; align-items: center; gap: 16px; flex-wrap: nowrap;
            padding: 0; margin-bottom: 20px; background: transparent; border: none;
            overflow: visible;
        }
        .eur-toolbar-main {
            display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap;
        }
        .eur-period-tabs {
            display: inline-flex; flex-shrink: 0; align-items: stretch;
            height: 42px; box-sizing: border-box;
            border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; background: #fff;
        }
        .eur-period-tabs .tab {
            display: inline-flex; align-items: center; justify-content: center;
            height: 42px; padding: 0 18px; border: none; border-right: 1px solid #d1d5db;
            cursor: pointer; font-size: 14px; background: #fff; color: #374151;
            white-space: nowrap; line-height: 1; font-weight: 500; box-sizing: border-box;
        }
        .eur-period-tabs .tab:last-child { border-right: none; }
        .eur-period-tabs .tab.active { background: #f3f4f6; color: #111827; font-weight: 600; }
        .eur-period-tabs .tab:hover:not(.active) { background: #fafafa; }
        .eur-period-picker-wrap { position: relative; flex-shrink: 0; }
        .eur-period-trigger {
            display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
            min-width: 220px; height: 42px; padding: 0 12px 0 14px;
            border: 1px solid #d1d5db; border-radius: 6px; background: #fff;
            font-size: 14px; color: #111827; cursor: pointer; box-sizing: border-box;
        }
        .eur-period-trigger:hover { border-color: #9ca3af; }
        .eur-period-trigger.open { border-color: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,0.12); }
        .eur-period-trigger-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .eur-period-trigger-label.is-placeholder { color: #9ca3af; }
        .eur-period-trigger-ic { width: 18px; height: 18px; color: #374151; flex-shrink: 0; }
        .eur-period-popover {
            display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 1400;
            background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
            box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
            min-width: 320px;
        }
        .eur-period-popover.open { display: block; }
        .eur-period-popover.eur-popover-wide { min-width: 560px; }
        .eur-period-popover.eur-popover-days { min-width: 620px; }
        .eur-period-popover-grid {
            display: grid; grid-template-columns: 168px 1fr; min-height: 260px;
        }
        .eur-period-popover-grid.single-col { grid-template-columns: 1fr; }
        .eur-period-quick {
            padding: 14px 12px; border-right: 1px solid #eef2f7;
            display: flex; flex-direction: column; gap: 2px;
        }
        .eur-period-quick-item {
            border: none; background: transparent; text-align: left;
            padding: 10px 12px; border-radius: 8px; font-size: 14px; color: #374151; cursor: pointer;
        }
        .eur-period-quick-item:hover { background: #f3f4f6; color: #111827; }
        .eur-period-main { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
        .eur-period-nav {
            display: flex; align-items: center; justify-content: center; gap: 16px;
        }
        .eur-period-nav-btn {
            width: 32px; height: 32px; border: none; border-radius: 8px; background: transparent;
            color: #374151; font-size: 18px; cursor: pointer; line-height: 1;
        }
        .eur-period-nav-btn:hover { background: #f3f4f6; }
        .eur-period-nav-label { font-size: 16px; font-weight: 600; color: #111827; min-width: 64px; text-align: center; }
        .eur-period-tile-grid { display: grid; gap: 8px; }
        .eur-period-tile-grid.quarters { grid-template-columns: 1fr 1fr; }
        .eur-period-tile-grid.months { grid-template-columns: repeat(3, 1fr); }
        .eur-period-tile-grid.years { grid-template-columns: repeat(3, 1fr); }
        .eur-period-tile {
            border: none; background: transparent; border-radius: 8px;
            padding: 12px 10px; font-size: 14px; color: #374151; cursor: pointer; text-align: center;
        }
        .eur-period-tile:hover { background: #f3f4f6; color: #111827; }
        .eur-period-tile.active { background: #ede9fe; color: #312e81; font-weight: 600; }
        .eur-period-cal-head {
            display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center;
        }
        .eur-period-cal-nav-row {
            display: grid; grid-template-columns: 36px 1fr 36px; align-items: center;
        }
        .eur-period-cal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .eur-period-month {
            border: 1px solid #eef2f7; border-radius: 8px; padding: 8px;
            display: flex; flex-direction: column; min-height: 0;
        }
        .eur-period-month-title { text-align: center; font-weight: 600; margin: 0 0 6px; color: #111827; font-size: 15px; }
        .eur-period-weekdays, .eur-period-days { display: grid; grid-template-columns: repeat(7, 1fr); }
        .eur-period-weekdays span { text-align: center; font-size: 12px; color: #6b7280; font-weight: 500; padding: 2px 0; }
        .eur-period-day {
            border: none; background: transparent; border-radius: 8px; font-size: 13px;
            color: #374151; padding: 6px 0; cursor: pointer; min-height: 32px;
        }
        .eur-period-day:hover { background: #f3f4f6; }
        .eur-period-day.muted { color: transparent; pointer-events: none; }
        .eur-period-day.today { font-weight: 700; color: #111827; }
        .eur-period-day.in-range { background: #eceaf0; color: #1f1e3a; border-radius: 0; }
        .eur-period-day.active { background: #343456; color: #fff; font-weight: 700; }
        .eur-period-day.range-start { border-radius: 8px 0 0 8px; }
        .eur-period-day.range-end { border-radius: 0 8px 8px 0; }
        .eur-period-day.range-single { border-radius: 8px; }
        .eur-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
        .eur-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
        .eur-table th { text-align: left; padding: 12px 14px; background: #f9fafb; font-size: 13px; color: #374151; border-bottom: 1px solid #e5e7eb; }
        .eur-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: top; }
        .eur-table tr.eur-row-parent td { font-weight: 600; background: #fafbfc; }
        .eur-table tr.eur-row-sub td { color: #4b5563; font-size: 13px; }
        .eur-table tr.eur-row-sub.collapsed { display: none; }
        .eur-table tr.eur-row-total td { font-weight: 700; background: #f8fafc; }
        .eur-table tr.eur-row-clickable { cursor: pointer; }
        .eur-table tr.eur-row-clickable:hover td { background: #f3f4f6; }
        .eur-table .eur-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
        .eur-table .eur-kz { width: 72px; color: #6b7280; }
        .eur-chevron {
            display: inline-block; width: 18px; margin-right: 6px; border: none; background: transparent;
            font-size: 16px; line-height: 1; color: #6b7280; cursor: pointer; transform: rotate(0deg); transition: transform 0.15s ease;
        }
        .eur-chevron.expanded { transform: rotate(90deg); }
        .ustva-send-form label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
        .ustva-send-form input, .ustva-send-form select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; margin-bottom: 10px; }
        .ustva-send-toggles { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
        .ustva-send-toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-height: 28px;
        }
        .ustva-send-toggle-row > span { font-size: 14px; color: #111827; font-weight: 500; }
        .ustva-send-switch {
            position: relative;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
            margin: 0;
        }
        .ustva-send-switch input {
            opacity: 0;
            width: 0;
            height: 0;
            position: absolute;
        }
        .ustva-send-switch-sl {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: #d1d5db;
            border-radius: 999px;
            transition: background 0.2s;
        }
        .ustva-send-switch-sl:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background: #fff;
            border-radius: 50%;
            transition: transform 0.2s;
            box-shadow: 0 1px 2px rgba(0,0,0,0.15);
        }
        .ustva-send-switch input:checked + .ustva-send-switch-sl { background: #4a90e2; }
        .ustva-send-switch input:checked + .ustva-send-switch-sl:before { transform: translateX(20px); }
        .ustva-send-positions { display: block; width: fit-content; max-width: 100%; border-radius: 0; }
        .ustva-send-positions table.ustva-elster-grid {
            width: 388px;
            max-width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
            border-spacing: 0;
            font-size: 13px;
            color: #111827;
            border: 1px solid #9ca3af;
            border-radius: 0;
            background: #fff;
        }
        .ustva-elster-grid col.ustva-elster-col-kz { width: 42px; }
        .ustva-elster-grid col.ustva-elster-col-amt { width: 152px; }
        .ustva-elster-grid th,
        .ustva-elster-grid td {
            padding: 7px 10px;
            border-bottom: 1px solid #b8bcc4;
            vertical-align: middle;
            background: #fff;
            border-radius: 0;
            box-sizing: border-box;
            overflow: hidden;
        }
        .ustva-elster-grid th:not(:last-child),
        .ustva-elster-grid td:not(:last-child) {
            border-right: 1px dotted #9ca3af;
        }
        .ustva-elster-grid thead th {
            font-weight: 600;
            background: #e8eaef;
            border-bottom: 1px solid #9ca3af;
            vertical-align: top;
        }
        .ustva-elster-grid tbody td { background: #fff; }
        .ustva-elster-grid .ustva-elster-kz {
            width: 42px;
            min-width: 42px;
            max-width: 42px;
            padding-left: 8px;
            padding-right: 4px;
            text-align: left;
            font-weight: 700;
        }
        .ustva-elster-grid .ustva-elster-amt {
            text-align: right;
            white-space: nowrap;
        }
        .ustva-elster-grid .ustva-elster-amt-val {
            width: 152px;
            min-width: 152px;
            max-width: 152px;
        }
        .ustva-elster-grid thead .ustva-elster-amt-head {
            text-align: left;
            font-weight: 600;
            font-size: 12px;
            line-height: 1.35;
            white-space: normal;
            word-break: normal;
            overflow-wrap: normal;
            hyphens: manual;
            padding-top: 8px;
            padding-bottom: 8px;
        }
        .ustva-elster-grid thead .ustva-elster-amt-head-tax {
            text-align: left;
            font-weight: 600;
            font-size: 13px;
            vertical-align: middle;
            white-space: nowrap;
        }
        .ustva-elster-grid .ustva-elster-h-line2 {
            font-weight: 500;
            font-size: 12px;
            line-height: 1.35;
        }
        .ustva-elster-grid .ustva-elster-h-sub {
            font-weight: 400;
            font-size: 11px;
            color: #6b7280;
            margin-left: 4px;
        }
        .ustva-table td.ustva-num, .ustva-table th.ustva-num { text-align: right; white-space: nowrap; }
        .ustva-table td.ustva-kz, .ustva-table th.ustva-kz {
            width: 42px;
            min-width: 42px;
            text-align: left;
            font-weight: 700;
            color: #111827;
            padding-left: 10px;
            padding-right: 6px;
        }
        .ustva-protocol-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .ustva-protocol-table th { text-align: left; padding: 10px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
        .ustva-protocol-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }

        #bank-tx-rows tr.bank-tx-clickable:hover { background: #f8fafc; }
        .bank-transfer-dialog {
            background: #fff; border-radius: 12px; width: min(520px, calc(100vw - 32px));
            max-height: calc(100vh - 48px); overflow: auto;
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
        }
        .bank-transfer-head {
            display: flex; justify-content: space-between; align-items: center;
            padding: 18px 20px; border-bottom: 1px solid #eef2f7;
        }
        .bank-transfer-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
        .bank-transfer-body { padding: 16px 20px 20px; }
        .bank-transfer-section label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; font-weight: 500; }
        .bank-transfer-section select, .bank-transfer-section input {
            width: 100%; padding: 9px 10px; border: 1px solid var(--border);
            border-radius: 6px; font-size: 14px; box-sizing: border-box;
        }
        .bank-transfer-list {
            border: 1px solid #e5e7eb; border-radius: 8px;
            max-height: 220px; overflow-y: auto; margin-top: 10px;
        }
        .bank-transfer-item {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer;
        }
        .bank-transfer-item:last-child { border-bottom: none; }
        .bank-transfer-item:hover { background: #f9fafb; }
        .bank-transfer-item.selected { background: #eef2ff; }
        .bank-transfer-item-main { flex: 1; min-width: 0; }
        .bank-transfer-item-amt { font-weight: 600; white-space: nowrap; }
        .bank-transfer-source-card {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #fff;
            padding: 12px 14px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        }
        .bank-transfer-source-meta .doc-title {
            font-size: 14px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 2px;
        }
        .bank-transfer-source-meta .doc-sub {
            font-size: 13px;
            color: #6b7280;
            margin-bottom: 4px;
        }
        .bank-transfer-source-meta .doc-amt {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 2px;
        }
        .bank-transfer-source-meta .doc-date {
            font-size: 13px;
            color: #6b7280;
        }
        .bank-transfer-arrow { text-align: center; color: #9ca3af; padding: 8px 0; font-size: 18px; }
        .bank-transfer-foot {
            display: flex; justify-content: flex-end; gap: 10px;
            padding: 14px 20px; border-top: 1px solid #eef2f7;
        }
        .bank-row-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 4px;
            min-width: 104px;
        }
        .bank-row-action-icon,
        .bank-row-action-unlink,
        .bank-row-action-reopen {
            opacity: 1;
            color: #6b7280;
            font-size: 15px;
            padding: 4px;
            transition: color 0.15s;
            cursor: pointer;
            background: none;
            border: none;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            flex-shrink: 0;
        }
        .bank-row-action-icon:hover { color: #2563eb; }
        .bank-row-action-unlink:hover { color: #c14949; }
        .bank-row-action-reopen:hover { color: #2563eb; }
        .bank-action-svg { width: 17px; height: 17px; display: block; }
        .acct-paginated-table td.bank-tx-actions-cell {
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
            padding-left: 6px;
            padding-right: 8px;
        }
        .bank-tx-menu-popover {
            display: none;
            position: fixed;
            z-index: 12050;
            min-width: 240px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
            padding: 6px 0;
        }
        .bank-tx-menu-popover.open { display: block; }
        .bank-tx-menu-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            width: 100%;
            border: none;
            background: none;
            text-align: left;
            padding: 10px 14px;
            cursor: pointer;
            color: #111827;
            font-size: 14px;
            line-height: 1.35;
        }
        .bank-tx-menu-item:hover { background: #f9fafb; }
        .bank-tx-menu-item.danger { color: #b91c1c; }
        .bank-tx-menu-item .menu-icon {
            width: 18px;
            flex-shrink: 0;
            color: #6b7280;
            text-align: center;
            margin-top: 1px;
        }
        .bank-tx-menu-item.danger .menu-icon { color: #b91c1c; }
        .bank-tx-menu-item .menu-text { min-width: 0; }
        .bank-tx-menu-item .menu-sub { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
        #bank-transfer-modal .bank-assign-foot {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 14px 20px 18px;
            border-top: 1px solid #eef2f7;
            margin-top: 0;
        }
        #paypal-workflow-modal .bank-assign-dialog {
            width: min(680px, calc(100vw - 32px));
        }
        .paypal-wf-summary {
            margin: 0 0 14px;
            padding: 12px 14px;
            border-radius: 10px;
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            font-size: 13px;
            line-height: 1.5;
            color: #1e3a5f;
        }
        .paypal-wf-steps { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
        .paypal-wf-step {
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 12px 14px;
            background: #fff;
        }
        .paypal-wf-step.active { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb22; }
        .paypal-wf-step.done { background: #f0fdf4; border-color: #bbf7d0; }
        .paypal-wf-step.blocked { opacity: 0.55; }
        .paypal-wf-step-head { display: flex; align-items: flex-start; gap: 10px; }
        .paypal-wf-step-badge {
            flex-shrink: 0;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            background: #e5e7eb;
            color: #374151;
        }
        .paypal-wf-step.done .paypal-wf-step-badge { background: #16a34a; color: #fff; }
        .paypal-wf-step.active .paypal-wf-step-badge { background: #2563eb; color: #fff; }
        .paypal-wf-step-title { font-weight: 600; font-size: 14px; color: #111827; }
        .paypal-wf-step-desc { font-size: 13px; color: #6b7280; margin-top: 4px; line-height: 1.45; }
        .paypal-wf-candidates { margin-top: 8px; font-size: 12px; color: #4b5563; }
        .paypal-wf-tx-card {
            margin-bottom: 14px;
            padding: 12px 14px;
            border-radius: 10px;
            background: #f9fafb;
            border: 1px solid #e5e7eb;
        }
        .bank-row-action-paypal {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.02em;
            color: #1d4ed8;
            border: 1px solid #bfdbfe;
            background: #eff6ff;
            border-radius: 6px;
            padding: 4px 6px;
            line-height: 1;
        }
        #credit-note-create-modal .bank-assign-dialog {
            width: min(560px, calc(100vw - 32px));
        }
        #credit-note-create-modal .bank-transfer-body {
            flex: none;
            overflow: visible;
            padding: 18px 22px 8px;
        }
        #credit-note-create-modal .bank-assign-foot {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
            padding: 16px 22px 22px;
            margin-top: 0;
            border-top: 1px solid #e5e7eb;
        }
        #credit-note-create-modal .credit-note-ref-input {
            width: 100%;
            padding: 9px 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }
        #credit-note-create-modal .credit-note-ref-wrap {
            position: relative;
        }
        #credit-note-create-modal .credit-note-ref-dropdown {
            margin-top: 4px;
            border: 1px solid #d6dbe4;
            border-radius: 8px;
            background: #fff;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            max-height: 240px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        #credit-note-create-modal .credit-note-ref-item {
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid #eef2f7;
        }
        #credit-note-create-modal .credit-note-ref-item:last-child {
            border-bottom: none;
        }
        #credit-note-create-modal .credit-note-ref-item:hover,
        #credit-note-create-modal .credit-note-ref-item.active {
            background: #eff6ff;
        }
        #credit-note-create-modal .credit-note-ref-item strong {
            display: block;
            font-size: 14px;
            color: #111827;
            line-height: 1.35;
        }
        #credit-note-create-modal .credit-note-ref-item small {
            display: block;
            color: #6b7280;
            font-size: 12px;
            margin-top: 2px;
        }
        #credit-note-create-modal .credit-note-ref-empty {
            padding: 10px 12px;
            color: #6b7280;
            font-size: 13px;
        }


        .action-bar { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }
        .search-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; width: 250px; font-family: inherit; }

        table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px 8px 0 0; overflow: hidden; border: 1px solid var(--border); border-bottom: none; font-size: 14px; }
        th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #f0f0f0; }
        th { background: #fafafa; color: #666; font-weight: 500; }
        .td-subtext { color: #888; font-size: 12px; display: block; margin-top: 2px; }

        .table-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: white; border: 1px solid var(--border); border-top: 1px solid #f0f0f0; border-radius: 0 0 8px 8px; font-size: 13px; color: var(--text-light); }
        .pagination-controls { display: flex; align-items: center; gap: 15px; }
        .pagination-controls select { width: auto; padding: 4px; border: 1px solid var(--border); border-radius: 4px; }

        .status { padding: 4px 10px; border-radius: 12px; font-size: 12px; display: inline-block; font-weight: 500; }
        .st-erhalten { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
        .st-abgelehnt { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }
        .st-offen { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
        .st-entwurf { background: #ede7f6; color: #5e35b1; border: 1px solid #d1c4e9; }
        .st-bezahlt { background: #e0f2f1; color: #00695c; border: 1px solid #b2dfdb; }

        tbody tr { cursor: pointer; transition: background 0.1s; }
        tbody tr:hover { background: #f4f6f8; }
        .kb-drop-target { outline: 2px dashed #4a90e2; outline-offset: -2px; background: #eef6ff !important; }
        .row-action { opacity: 0; color: #9ca3af; font-size: 15px; padding: 2px 6px; transition: opacity 0.15s, color 0.15s; cursor: pointer; background: none; border: none; }
        .row-action:hover { color: #c14949; }
        tbody tr:hover .row-action { opacity: 1; }

        .quick-actions { display: flex; gap: 20px; margin-bottom: 30px; }
        .action-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 20px; flex: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 500;}
        .dashboard-main { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 30px; }
        .dashboard-header { display: flex; justify-content: space-between; margin-bottom: 30px; }
        .kpi-title { font-size: 14px; color: var(--text-light); margin: 0 0 5px 0; }
        .kpi-value { font-size: 32px; font-weight: bold; margin: 0; }
        .acc-overview-actions { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
        .acc-overview-action-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-height: 84px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 8px; cursor: pointer; }
        .acc-overview-action-card:hover { background: #f8fafc; border-color: #d8dee7; }
        .acc-overview-action-title { font-size: 16px; line-height: 1; color: #111827; }
        .acc-overview-action-text { font-size: 15px; line-height: 1.2; color: #111827; font-weight: 600; }
        .acc-overview-finance-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; }
        .acc-overview-finance-counters { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
        .acc-overview-counter { border: 1px solid #edf0f4; background: #f9fafc; border-radius: 8px; padding: 10px 14px; min-width: 150px; }
        .acc-overview-counter-k { font-size: 12px; color: #64748b; margin-bottom: 4px; display: block; }
        .acc-overview-counter-v { font-size: 32px; font-weight: 700; color: #111827; margin: 0; }
        .acc-overview-counter-v.small { font-size: 20px; }
        .acc-overview-counter-pill { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; transform: translateY(-1px); }
        .acc-overview-period-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef2f7; gap: 10px; flex-wrap: wrap; position: relative; }
        .acc-overview-period-trigger { border: none; background: transparent; font-size: 16px; font-weight: 600; color: #1f2937; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
        .acc-overview-period-trigger:hover { color: #111827; }
        .acc-overview-period-arrow { font-size: 12px; color: #64748b; }
        .acc-overview-period-menu {
            position: absolute;
            left: 0;
            bottom: calc(100% + 8px);
            width: 940px;
            max-width: calc(100vw - 340px);
            background: #fff;
            border: 1px solid #dde3ec;
            border-radius: 14px;
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
            display: none;
            z-index: 2200;
        }
        .acc-overview-period-menu.open { display: block; }
        .acc-overview-period-menu-grid { display: grid; grid-template-columns: 230px 1fr; height: 380px; }
        .acc-overview-period-quick { max-height: 100%; overflow-y: auto; padding: 12px; border-right: 1px solid #eef2f7; }
        .acc-overview-period-quick-item {
            border: none;
            background: transparent;
            width: 100%;
            text-align: left;
            padding: 10px 10px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 15px;
            color: #1f2937;
        }
        .acc-overview-period-quick-item:hover { background: #f3f5f9; color: #111827; }
        .acc-overview-period-quick-item.active { background: #ede9fe; color: #312e81; font-weight: 600; }
        .acc-overview-period-main { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
        .acc-overview-period-cal-head { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; margin-bottom: 2px; }
        .acc-overview-period-cal-nav-row { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
        .acc-overview-period-cal-nav-row .left { justify-self: start; }
        .acc-overview-period-cal-nav-row .right { justify-self: end; }
        .acc-overview-period-cal-nav {
            border: none;
            background: transparent;
            font-size: 20px;
            line-height: 1;
            cursor: pointer;
            color: #1f2937;
            padding: 4px 8px;
            border-radius: 8px;
        }
        .acc-overview-period-cal-nav:hover { background: #f3f4f6; color: #111827; }
        .acc-overview-period-cal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1 1 auto; min-height: 0; }
        .acc-overview-period-month { border: 1px solid #eef2f7; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; min-height: 0; }
        .acc-overview-period-month-title { text-align: center; font-weight: 600; margin: 0; color: #111827; font-size: 17px; }
        .acc-overview-period-weekdays,
        .acc-overview-period-days { display: grid; grid-template-columns: repeat(7, 1fr); }
        .acc-overview-period-weekdays { gap: 4px; }
        .acc-overview-period-weekdays span { text-align: center; font-size: 12px; color: #6b7280; font-weight: 500; }
        .acc-overview-period-days { grid-template-rows: repeat(6, 1fr); flex: 1 1 auto; }
        .acc-overview-period-day {
            border: none;
            background: #fff;
            border-radius: 0;
            height: 36px;
            cursor: pointer;
            font: inherit;
            color: #111827;
            margin: 0;
            padding: 0;
        }
        .acc-overview-period-day:hover { background: #f3f4f6; }
        .acc-overview-period-day.muted { color: #cbd5e1; }
        .acc-overview-period-day.in-range { background: #eceaf0; color: #1f1e3a; }
        .acc-overview-period-day.active { background: #343456; color: #fff; font-weight: 700; border-radius: 12px; }
        .acc-overview-period-day.range-start { border-radius: 12px 0 0 12px; }
        .acc-overview-period-day.range-end { border-radius: 0 12px 12px 0; }
        .acc-overview-period-day.range-single { border-radius: 12px; }
        .acc-overview-period-menu-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
        .acc-overview-period-menu-actions { display: inline-flex; gap: 8px; }
        .acc-overview-period-btn {
            border-radius: 12px;
            border: 1px solid #d5dce6;
            background: #fff;
            padding: 9px 16px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            color: #1f2937;
        }
        .acc-overview-period-btn:hover { background: #f9fafb; }
        .acc-overview-period-btn.primary { background: #312e81; color: #fff; border-color: #312e81; }
        .acc-overview-period-btn.primary:hover { background: #2b276f; border-color: #2b276f; }
        .acc-overview-period-range { font-size: 13px; color: #6b7280; }
        .acc-overview-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
        .acc-overview-list-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
        .acc-overview-list-title { font-size: 20px; margin: 0 0 14px 0; }
        .acc-overview-badge-row { border: 1px solid #eef1f5; border-radius: 8px; background: #f8fafc; padding: 12px 14px; margin-bottom: 10px; }
        .acc-overview-badge-val { font-size: 38px; font-weight: 700; margin: 0; }
        .acc-overview-list-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid #eef2f7; font-size: 15px; }
        .acc-overview-list-row:last-child { border-bottom: none; }
        .acc-overview-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 2px 7px; border-radius: 999px; font-size: 12px; margin-right: 8px; }
        .inv-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
        .inv-page-head-title-wrap { display:flex; align-items:baseline; gap:10px; flex-wrap:nowrap; }
        .inv-page-head h1 { margin:0; font-size:38px; font-weight:700; color:#111827; white-space:nowrap; }
        .inv-doc-draft-label { font-size:22px; font-weight:600; color:#6b7280; white-space:nowrap; line-height:1.2; }
        #quote-doc-head .inv-head-actions,
        #invoice-doc-head .inv-head-actions,
        #mahnung-detail-head .inv-head-actions { flex-wrap:nowrap; justify-content:flex-end; flex:0 0 auto; }
        #quote-doc-head,
        #invoice-doc-head,
        #mahnung-detail-head { flex-wrap:nowrap; align-items:center; }
        .inv-page-sub { margin:4px 0 0 0; color:#6b7280; font-size:14px; }
        .inv-head-actions { display:inline-flex; flex-wrap:nowrap; gap:10px; align-items:center; }
        .inv-head-actions .inv-head-btn { white-space:nowrap; flex-shrink:0; }
        .inv-head-btn { border:1px solid #d9dee7; background:#fff; border-radius:10px; padding:10px 14px; font-weight:600; color:#111827; cursor:pointer; }
        .inv-head-btn.primary { background:#312e81; color:#fff; border-color:#312e81; }
        .inv-split-btn-wrap { position: relative; display: inline-block; }
        .inv-split-btn { display: inline-flex; align-items: stretch; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px #312e81; }
        .inv-split-btn .inv-head-btn.primary { border-radius: 0; border: none; margin: 0; }
        .inv-split-btn-main { border-right: 1px solid rgba(255,255,255,0.28) !important; }
        .inv-split-btn-caret { padding: 10px 12px !important; min-width: 44px; font-size: 14px; line-height: 1; }
        .inv-split-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 280px; background: #fff; border: 1px solid #d6dbe4; border-radius: 12px; box-shadow: 0 10px 26px rgba(0,0,0,.14); z-index: 2000; padding: 6px 0; }
        .inv-split-dropdown-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: none; background: none; font: inherit; font-size: 15px; color: #111827; cursor: pointer; box-sizing: border-box; }
        .inv-split-dropdown-item:hover { background: #f3f4f6; }
        .rec-inv-radio-row { display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; cursor: pointer; margin: 0 0 10px 0; text-align: left; width: 100%; box-sizing: border-box; }
        .rec-inv-radio-row input[type="radio"] { margin: 4px 0 0 0; flex-shrink: 0; order: -1; }
        /* .inv-create-sec label ist display:block — muss für Radios überschrieben werden (Kreis links vom Text) */
        .inv-create-sec label.rec-inv-radio-row {
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 10px;
            margin: 0 0 10px 0;
            font-weight: 500;
            color: #4b5563;
        }
        .inv-create-sec label.rec-inv-radio-row input[type="radio"] { margin: 4px 0 0 0; flex-shrink: 0; order: -1; }
        .rec-inv-automation-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 24px 40px;
            align-items: start;
            margin-top: 14px;
        }
        .rec-inv-automation-row.rec-inv-automation-two-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
        @media (max-width: 900px) {
            .rec-inv-automation-row.rec-inv-automation-two-cols { grid-template-columns: minmax(0, 1fr); }
        }
        .inv-shell { border:1px solid #e5e7eb; border-radius:12px; background:#fff; overflow:hidden; }
        .inv-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; border-bottom:1px solid #edf1f5; }
        .inv-tabs { display:flex; gap:6px; flex-wrap:wrap; }
        .inv-tab { border:none; background:transparent; color:#374151; font-size:14px; font-weight:600; padding:8px 12px; border-radius:10px; cursor:pointer; }
        .inv-tab:hover { background:#f3f4f6; }
        .inv-tab.active { background:#eef2ff; color:#312e81; }
        .inv-tools { display:inline-flex; gap:8px; }
        .inv-tool-btn { border:1px solid #d9dee7; background:#fff; border-radius:10px; padding:8px 12px; font-weight:600; font-size:14px; color:#374151; cursor:pointer; }
        .inv-table-wrap { overflow:auto; }
        .inv-table { width:100%; min-width:980px; border-collapse:separate; border-spacing:0; border:none; border-radius:0; }
        .inv-table th { background:#f8fafc; color:#6b7280; font-size:13px; font-weight:700; padding:12px 14px; border-bottom:1px solid #edf1f5; white-space:nowrap; }
        .inv-table td { padding:12px 14px; border-bottom:1px solid #edf1f5; vertical-align:top; }
        .inv-table tr:last-child td { border-bottom:none; }
        /* Feste Spaltenbreiten — kein Springen beim Blättern (Rechnungen, Angebote, Belege, …) */
        .inv-table-wrap .acct-paginated-table,
        table.acct-paginated-table {
            table-layout: fixed;
            width: 100%;
        }
        .acct-paginated-table thead th,
        .acct-paginated-table tbody td {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            box-sizing: border-box;
            vertical-align: middle;
            height: auto;
            min-height: 48px;
            padding: 12px 14px;
        }
        .acct-paginated-table tbody td .inv-customer-sub {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-top: 2px;
        }
        .acct-paginated-table .inv-money { text-align: right; white-space: nowrap; }
        .inv-table-wrap table.acct-paginated-table { min-width: 980px; }
        .inv-table-wrap.bank-table-wrap table.bank-tx-table.acct-paginated-table { min-width: 0; }
        .crm-table.acct-paginated-table tbody td {
            height: auto;
            min-height: 48px;
        }
        .acct-paginated-table col.col-w-status { width: 130px; }
        .acct-paginated-table col.col-w-status-sm { width: 100px; }
        .acct-paginated-table col.col-w-status-md { width: 120px; }
        .acct-paginated-table col.col-w-due { width: 130px; }
        .acct-paginated-table col.col-w-nr { width: 140px; }
        .acct-paginated-table col.col-w-mahn-stufe { width: 120px; }
        .acct-paginated-table col.col-w-date { width: 92px; }
        .acct-paginated-table col.col-w-date-sm { width: 100px; }
        .acct-paginated-table col.col-w-docs { width: 120px; }
        .acct-paginated-table col.col-w-money { width: 120px; }
        .acct-paginated-table col.col-w-money-sm { width: 110px; }
        .acct-paginated-table col.col-w-money-xs { width: 100px; }
        .acct-paginated-table col.col-w-icon { width: 48px; }
        .acct-paginated-table col.col-w-bank-actions { width: 112px; }
        .acct-paginated-table col.col-w-beleg-added { width: 104px; }
        .acct-paginated-table col.col-w-beleg-date { width: 104px; }
        .acct-paginated-table col.col-w-bank-name { width: 200px; }
        .acct-paginated-table col.col-w-bank-purpose { width: 280px; }
        .acct-paginated-table col.col-w-bank-link { width: 140px; }
        .acct-paginated-table col.col-w-bank-status { width: 132px; }
        .acct-paginated-table td.bank-tx-status-cell,
        .acct-paginated-table td.bank-tx-link-cell {
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
        }
        table.bank-tx-table td.bank-tx-link-cell {
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .acct-paginated-table td.bank-tx-status-cell .status {
            white-space: nowrap;
            max-width: none;
        }
        .acct-paginated-table td.bank-tx-name-cell,
        .acct-paginated-table td.bank-purpose-cell {
            white-space: normal;
            overflow: hidden;
            text-overflow: clip;
        }
        .inv-status { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:4px 10px; font-size:12px; font-weight:700; white-space:nowrap; }
        .inv-status::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.8; }
        .inv-status.open { background:#fff7d6; color:#8a6a00; }
        .inv-status.due { background:#fee2e2; color:#b91c1c; }
        .inv-status.paid { background:#dcfce7; color:#166534; }
        .inv-status.cancelled { background:#f3f4f6; color:#6b7280; }
        .inv-status.other { background:#e5e7eb; color:#374151; }
        .inv-status.expired { background:#fee2e2; color:#991b1b; }
        .inv-status.accepted { background:#dcfce7; color:#166534; }
        .inv-status.rejected { background:#fee2e2; color:#991b1b; }
        .inv-customer-sub { color:#6b7280; font-size:12px; margin-top:2px; display:block; }
        .inv-money { white-space:nowrap; font-weight:600; }
        .inv-icon-btn { border:none; background:transparent; color:#6b7280; cursor:pointer; font-size:16px; }
        .inv-doc-chip {
            display:inline-flex;
            align-items:center;
            justify-content:center;
            width:24px;
            height:24px;
            border-radius:999px;
            font-size:11px;
            font-weight:700;
            margin-right:4px;
            border:1px solid #d1d5db;
            vertical-align:middle;
        }
        .inv-doc-chip.idle {
            background:#f3f4f6;
            color:#9ca3af;
        }
        .inv-doc-chip.sent {
            background:#ecfdf5;
            color:#0f766e;
            border-color:#6ee7b7;
            cursor:pointer;
        }
        .inv-head-btn-danger { color:#b91c1c; border-color:#fecaca; }
        .inv-head-btn-danger:hover { background:#fef2f2; color:#991b1b; }
        .inv-pagesize { border:1px solid #d9dee7; border-radius:10px; padding:6px 10px; font:inherit; }
        #invoice-create-modal { align-items: flex-start; justify-content: center; padding: 18px; box-sizing: border-box; overflow-y: auto; }
        #invoice-create-modal .modal-content { margin: 0; width: min(1180px, calc(100vw - 36px)); max-width: none; border-radius: 14px; }
        .inv-create-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
        .inv-create-head h2 { margin:0; font-size:30px; font-weight:700; color:#111827; }
        .inv-create-actions { display:inline-flex; align-items:center; gap:8px; }
        .inv-create-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
        .inv-create-sec h3 { margin:0 0 8px 0; font-size:18px; font-weight:700; color:#111827; }
        .inv-create-sec label { display:block; font-size:13px; font-weight:600; color:#374151; margin:8px 0 4px; }
        /* Radio/Checkbox nicht auf 100% Breite — sonst reißen Zeilen mit label.rec-inv-radio-row auseinander */
        .inv-create-sec input:not([type="radio"]):not([type="checkbox"]),
        .inv-create-sec select,
        .inv-create-sec textarea {
            width:100%; box-sizing:border-box; border:1px solid #d6dbe4; border-radius:10px; padding:10px 12px; font:inherit; font-size:15px;
        }
        .inv-create-sec input[type="radio"],
        .inv-create-sec input[type="checkbox"] {
            width: auto;
            max-width: none;
            box-sizing: border-box;
        }
        .inv-create-sec textarea { min-height: 120px; resize: vertical; font-size:15px; line-height:1.45; }
        .inv-create-sec input.inv-readonly,
        .inv-create-sec textarea.inv-readonly,
        .inv-create-sec select.inv-readonly {
            background: #f2f4f7;
            color: #5b6673;
            cursor: default;
        }
        .contract-monitoring-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px 24px;
            margin-top: 10px;
            padding: 12px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #fafafa;
        }
        .contract-monitoring-grid label {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            font-weight: 500;
            font-size: 14px;
            margin: 4px 0;
            cursor: pointer;
        }
        .contract-s2-readonly .contract-s2-item {
            margin: 0 0 14px;
            padding-bottom: 12px;
            border-bottom: 1px solid #eef2f7;
        }
        .contract-s2-readonly .contract-s2-item:last-child { border-bottom: none; }
        .contract-s2-readonly .contract-s2-title { font-weight: 600; color: #111827; margin-bottom: 4px; }
        .contract-s2-readonly .contract-s2-desc { font-size: 14px; color: #4b5563; white-space: pre-wrap; line-height: 1.45; }
        .contract-para-item { margin: 0 0 10px; }
        .contract-para-item label { margin: 0 0 4px; color: #4b5563; font-size: 13px; }
        .contract-para-item textarea { min-height: 92px; }
        .inv-create-row { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
        .inv-rec-suggest { position:relative; }
        .inv-rec-list { position:absolute; left:0; right:0; top:calc(100% + 4px); border:1px solid #d6dbe4; border-radius:12px; background:#fff; box-shadow:0 10px 26px rgba(0,0,0,.14); max-height:260px; overflow-y:auto; z-index:2500; }
        .inv-rec-item { padding:10px 12px; cursor:pointer; border-bottom:1px solid #eef2f7; }
        .inv-rec-item:last-child { border-bottom:none; }
        .inv-rec-item:hover { background:#f8fafc; }
        .inv-rec-item strong { display:block; font-size:14px; color:#111827; line-height:1.35; }
        .inv-rec-item small { color:#6b7280; font-size:12px; }
        #admin-invoice-customer-search, .inv-line-field input[type="text"] { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .inv-date-wrap { position:relative; }
        .inv-date-btn { position:absolute; right:10px; top:50%; transform:translateY(-50%); border:none; background:transparent; cursor:pointer; font-size:20px; color:#6b7280; }
        .inv-date-picker { position:fixed; left:0; top:0; width:332px; background:#fff; border:1px solid #d6dbe4; border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,.14); padding:8px; z-index:2600; display:none; }
        .inv-date-picker.open { display:block; }
        .inv-date-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
        .inv-date-head button { border:none; background:transparent; cursor:pointer; font-size:22px; color:#374151; }
        .inv-date-head strong { font-size:18px; color:#111827; }
        .inv-date-week, .inv-date-days { display:grid; grid-template-columns: repeat(7, 1fr); text-align:center; gap:2px; }
        .inv-date-week span { font-size:13px; color:#6b7280; padding:4px 0; }
        .inv-date-days button { border:none; background:#fff; border-radius:6px; min-height:30px; cursor:pointer; font:inherit; font-size:14px; color:#111827; }
        .inv-date-days button:hover { background:#eef2ff; }
        .inv-date-days button.active { background:#5b84d1; color:#fff; font-weight:700; border-radius:6px; }
        .inv-date-days button.in-range { background:#e8f0ff; color:#1f4e97; border-radius:0; }
        .inv-date-days button.muted { color:#9ca3af; }
        .inv-date-days button.muted.active { color:#fff; }
        .inv-line-head {
            display:grid;
            grid-template-columns: 14px minmax(320px, 3.5fr) 134px 162px 74px 110px 122px 36px;
            gap:6px;
            align-items:center;
            margin-bottom:4px;
            color:#6b7280;
            font-size:12px;
            font-weight:600;
            line-height:1.2;
        }
        .inv-line-list { margin-left: 0; overflow-x:visible; }
        .contract-line-head {
            display:grid;
            grid-template-columns: 14px minmax(0, 1fr) 72px 32px;
            gap:6px;
            align-items:center;
            margin-bottom:4px;
            color:#6b7280;
            font-size:12px;
            font-weight:600;
            line-height:1.2;
        }
        .contract-line-row {
            display:grid;
            grid-template-columns: minmax(0, 1fr) 72px 32px;
            gap:6px;
            align-items:center;
            margin-bottom:4px;
        }
        .beleg-form-panel .contract-line-head,
        .beleg-form-panel .contract-line-row { max-width: 100%; }
        .beleg-preview-body .contract-preview-a4 {
            width: min(calc(100% - 8px), 640px);
            max-width: 100%;
            margin: 0 auto;
            flex-shrink: 0;
        }
        .beleg-preview-body .contract-preview-a4 iframe {
            min-height: 0;
            height: 100%;
            position: absolute;
            inset: 0;
            width: 100%;
            border: none;
            background: #fff;
        }
        .acct-paginated-table td.inv-table-icon-cell {
            overflow: visible;
            text-overflow: clip;
            text-align: center;
            padding-left: 8px;
            padding-right: 8px;
        }
        .inv-line-item { display:grid; grid-template-columns: 14px 1fr; gap:6px; align-items:start; margin-bottom:6px; }
        .inv-line-card { border:none; border-radius:0; padding:0; }
        .inv-line-no-wrap { color:#111827; font-size:14px; line-height:1; user-select:none; display:flex; align-items:center; justify-content:center; gap:6px; min-height:40px; }
        .inv-line-no-wrap strong { font-size:14px; font-weight:600; min-width:14px; text-align:right; }
        .inv-line-row {
            display:grid;
            grid-template-columns: minmax(320px, 3.5fr) 134px 162px 74px 110px 122px 36px;
            gap:6px;
            align-items:center;
            margin-bottom:4px;
        }
        .inv-line-drag { border:none; background:transparent; color:#6b7280; cursor:grab; font-size:16px; line-height:1; padding:0 2px; display:none; }
        .inv-line-no-wrap:hover .inv-line-drag { display:inline-flex; }
        .inv-line-no-wrap:hover strong { display:none; }
        .inv-line-item.drag-over .inv-line-card { background:#f5f8ff; border-radius:8px; box-shadow: inset 0 0 0 1px #9fb5e8; }
        .inv-line-item.dragging .inv-line-card { opacity:.58; }
        .inv-line-item.dragging .inv-line-no-wrap { color:#5b84d1; }
        .inv-line-field label { display:block; font-size:12px; color:#6b7280; margin-bottom:4px; }
        .inv-line-field > input,
        .inv-line-field > select,
        .inv-line-field > .inv-rec-suggest > input {
            width:100%;
            box-sizing:border-box;
            border:1px solid #d6dbe4;
            border-radius:10px;
            padding:8px 10px;
            font:inherit;
            font-size:14px;
            background:#fff;
            appearance: none;
            -moz-appearance: textfield;
        }
        .inv-line-field > input::-webkit-outer-spin-button,
        .inv-line-field > input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .inv-line-total { text-align:right; font-size:13px; font-weight:700; color:#111827; white-space:nowrap; align-self:center; padding-right:0; }
        .inv-create-addr-block { display:grid; gap:8px; }
        .inv-create-subject-gap { margin-top: 10px; }
        .inv-link-row { margin-top:6px; display:flex; gap:18px; flex-wrap:wrap; margin-left:0; }
        .inv-link-btn { border:none; background:transparent; color:#5b5ac8; font-size:12px; font-weight:600; padding:0; cursor:pointer; text-decoration:none; }
        .inv-link-btn:hover { text-decoration:underline; }
        .beleg-create-shell { max-width: none; width: 100%; margin: 0; padding: 8px 0 32px; box-sizing: border-box; }
        .beleg-create-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
        .beleg-create-title-wrap { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
        .beleg-create-head h1 { margin:0; font-size:28px; font-weight:700; color:#111827; }
        .beleg-doc-opencloud-btn {
            flex-shrink:0;
            display:inline-flex;
            align-items:center;
            justify-content:center;
            width:32px;
            height:32px;
            border:1px solid #d1d5db;
            background:#f9fafb;
            color:#6b7280;
            border-radius:8px;
            cursor:pointer;
            padding:0;
        }
        .beleg-doc-opencloud-btn svg { display:block; }
        .beleg-doc-opencloud-btn:hover { border-color:#5b84d1; color:#1e3a5f; background:#eef2ff; }
        .beleg-doc-opencloud-btn:focus-visible { outline:2px solid #5b84d1; outline-offset:2px; }
        .beleg-create-actions { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
        .beleg-create-grid { display:grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap:24px; align-items:start; }
        .beleg-doc-panel { min-width: 0; }
        .beleg-form-panel { min-width: 0; max-width: 400px; justify-self: end; width: 100%; }
        .beleg-bank-payments {
            margin-bottom: 16px;
            padding: 12px 14px;
            border: 1px solid #bbf7d0;
            background: #f0fdf4;
            border-radius: 8px;
        }
        .beleg-bank-payments-head {
            font-weight: 600;
            color: #166534;
            margin-bottom: 8px;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .beleg-bank-payments-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .beleg-bank-payments-list li {
            font-size: 13px;
            padding: 5px 0;
            color: #111827;
            line-height: 1.45;
        }
        .beleg-bank-payments-list li strong { font-weight: 600; }
        .beleg-bank-payment-account { color: #6b7280; font-size: 12px; }
        .beleg-field .inv-date-wrap input.beleg-date-readonly {
            background: #fff;
            cursor: default;
        }
        @media (max-width: 960px) {
            .beleg-create-grid { grid-template-columns: 1fr; }
            .beleg-form-panel { max-width: none; justify-self: stretch; }
        }
        .beleg-upload-zone {
            border:2px dashed #c5cdd8; border-radius:16px; background:#f1f4f8; min-height:300px;
            display:flex; flex-direction:column; align-items:center; justify-content:center; padding:28px 20px;
            text-align:center; cursor:pointer; transition: border-color .15s, background .15s;
        }
        .beleg-upload-zone:hover, .beleg-upload-zone:focus-within { border-color:#9aa5b8; background:#e8ecf3; }
        .beleg-upload-zone.beleg-drag { border-color:#5b84d1; background:#e8f0ff; }
        .beleg-upload-zone .beleg-upload-btn { margin-bottom:10px; }
        .beleg-upload-hint { color:#6b7280; font-size:14px; margin:4px 0 0; line-height:1.45; }
        .beleg-upload-formats { color:#9ca3af; font-size:12px; margin-top:8px; }
        .beleg-upload-filename { margin-top:12px; font-size:13px; font-weight:600; color:#312e81; word-break:break-all; max-width:100%; }
        .beleg-doc-panel { position:relative; min-height:calc(100vh - 150px); }
        .beleg-preview-wrap {
            border:1px solid #e5e7eb; border-radius:14px; background:#eef0f4; overflow:hidden;
            display:flex; flex-direction:column; min-height:calc(100vh - 170px);
        }
        .beleg-preview-toolbar {
            display:flex; justify-content:space-between; align-items:center; gap:10px;
            padding:8px 12px; background:#fff; border-bottom:1px solid #e5e7eb;
            font-size:13px; color:#6b7280; flex-shrink:0;
        }
        .beleg-preview-actions { display:inline-flex; align-items:center; gap:4px; }
        .beleg-preview-actions button {
            border:1px solid #e5e7eb; background:#fff; border-radius:8px; width:34px; height:34px;
            cursor:pointer; font-size:16px; line-height:1; color:#374151;
        }
        .beleg-preview-actions button:hover { background:#f8fafc; border-color:#c5cdd8; }
        .beleg-preview-body.inv-doc-pdf-scroll {
            flex:1; min-height:0;
        }
        .inv-doc-pdf-page .beleg-preview-img {
            display:none;
            position:absolute;
            inset:0;
            width:100%;
            height:100%;
            object-fit:contain;
            background:#fff;
        }
        .inv-doc-pdf-scroll .beleg-preview-img {
            display:block; flex:0 0 auto; width:100%; max-width:min(100%,680px); height:auto;
            margin:0 auto; background:#fff;
            box-shadow:0 1px 3px rgba(0,0,0,.1), 0 4px 20px rgba(0,0,0,.12);
            border-radius:2px;
        }
        .beleg-preview-filename {
            padding:8px 12px 10px; font-size:12px; font-weight:600; color:#4b5563;
            word-break:break-all; background:#fff; border-top:1px solid #e5e7eb;
        }
        .beleg-preview-opencloud {
            padding:0 12px 10px; font-size:12px; color:#5b84d1; background:#fff;
        }
        .beleg-preview-opencloud a { color:inherit; }
        .inv-doc-readonly-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 340px;
            gap: 0;
            min-height: calc(100vh - 132px);
            margin: 0;
            background: #eef0f4;
            border-radius: 8px;
            overflow: hidden;
        }
        .inv-doc-readonly-main {
            display: flex;
            flex-direction: column;
            min-height: 0;
            min-width: 0;
            overflow: hidden;
            background: #eef0f4;
        }
        .inv-doc-pdf-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 8px 14px;
            background: #fff;
            border-bottom: 1px solid #d8dce3;
            flex-shrink: 0;
        }
        .inv-doc-pdf-toolbar-left {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            color: #374151;
        }
        .inv-doc-pdf-toolbar-left button {
            border: 1px solid #d1d5db;
            background: #fff;
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 13px;
            cursor: pointer;
            color: #374151;
        }
        .inv-doc-pdf-toolbar-left button:hover { background: #f9fafb; }
        .inv-doc-pdf-toolbar-actions {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .inv-doc-pdf-toolbar-actions button {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            color: #4b5563;
        }
        .inv-doc-pdf-toolbar-actions button:hover { background: #f3f4f6; }
        .inv-doc-pdf-zoom-label {
            font-size: 12px;
            color: #6b7280;
            padding: 4px 10px;
            border-radius: 6px;
            background: #f3f4f6;
        }
        /* Canonical PDF preview: .inv-doc-pdf-scroll > .inv-doc-pdf-page > iframe (+ .inv-doc-pdf-placeholder).
           Use setPdfIframeSrc() for every PDF iframe — do not add separate sizing rules elsewhere. */
        .inv-doc-pdf-scroll {
            flex: 1;
            overflow-x: hidden;
            overflow-y: auto;
            padding: 20px 16px 32px;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            background: #eef0f4;
        }
        .inv-doc-pdf-scroll .inv-doc-pdf-page {
            flex: 0 0 auto;
            width: 100%;
            max-width: min(100%, 680px);
            margin: 0 auto;
        }
        .inv-doc-pdf-page {
            width: 100%;
            max-width: 100%;
            aspect-ratio: 210 / 297;
            min-height: 280px;
            background: #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 4px 20px rgba(0,0,0,.12);
            border-radius: 2px;
            overflow: hidden;
            position: relative;
        }
        .inv-doc-pdf-page iframe {
            display: block;
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            border: none;
            background: #fff;
            overflow: hidden;
        }
        .inv-doc-pdf-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            inset: 0;
            color: #6b7280;
            font-size: 14px;
            background: #fff;
        }
        .inv-doc-readonly-aside {
            background: #fff;
            padding: 0 16px 24px;
            overflow: hidden;
            border-left: 1px solid #eef0f4;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .inv-doc-aside-toolbar-spacer {
            flex-shrink: 0;
            min-height: 49px;
            box-sizing: border-box;
        }
        .inv-doc-aside-scroll {
            flex: 1;
            overflow-x: hidden;
            overflow-y: auto;
            min-height: 0;
            padding: 16px 0 0;
        }
        #invoice-doc-summary-body,
        #quote-doc-summary-body,
        #contract-doc-summary-body {
            display: flex;
            flex-direction: column;
            gap: 28px;
        }
        .inv-doc-card {
            background: #fff;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            box-shadow: none;
            padding: 16px 18px;
        }
        .inv-doc-skr04-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
            margin-top: 8px;
        }
        .inv-doc-skr04-table th,
        .inv-doc-skr04-table td {
            padding: 6px 4px;
            border-bottom: 1px solid #eef2f7;
            text-align: left;
            vertical-align: top;
        }
        .inv-doc-skr04-table th {
            color: #6b7280;
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.02em;
        }
        .inv-doc-skr04-table td.num {
            text-align: right;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
        }
        .inv-doc-skr04-table tr:last-child td {
            border-bottom: none;
        }
        .inv-doc-card-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .inv-doc-card-nav .doc-nr {
            font-size: 18px;
            font-weight: 700;
            color: #111827;
            letter-spacing: -0.02em;
        }
        .inv-doc-card-nav-btns {
            display: flex;
            gap: 4px;
        }
        .inv-doc-card-nav-btns button {
            width: 32px;
            height: 32px;
            border: 1px solid #e5e7eb;
            background: #fff;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            color: #6b7280;
        }
        .inv-doc-card-nav-btns button:hover { background: #f9fafb; }
        .inv-doc-card-nav-btns button:disabled { opacity: .35; cursor: default; }
        .inv-doc-card-summary { position: relative; }
        .inv-doc-card-summary-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 14px;
        }
        .inv-doc-card-summary-head .cust {
            font-size: 15px;
            font-weight: 700;
            color: #111827;
            line-height: 1.35;
            padding-right: 8px;
        }
        .inv-doc-card-summary-head .meta-date {
            font-size: 13px;
            color: #6b7280;
            margin-top: 4px;
        }
        .inv-doc-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .inv-doc-pill.open { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
        .inv-doc-pill.due { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
        .inv-doc-pill.paid { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
        .inv-doc-pill.cancelled { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
        .inv-doc-pill.expired { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
        .inv-doc-pill.contract-active { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
        .inv-doc-pill.contract-expiring { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
        .inv-doc-pill.contract-expired { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
        .inv-doc-pill.accepted { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
        .inv-doc-pill.rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
        .inv-doc-pill::before {
            content: '';
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: currentColor;
            opacity: .85;
        }
        .inv-doc-amount-row {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
            padding-top: 0;
            border-top: none;
        }
        .inv-doc-card-summary-head + .inv-doc-amount-row {
            margin-top: 10px;
        }
        .inv-doc-amount-row + .inv-doc-amount-row {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #eef2f7;
        }
        .inv-doc-amount-row .lbl {
            font-size: 13px;
            color: #6b7280;
        }
        .inv-doc-amount-row .val {
            font-size: 22px;
            font-weight: 700;
            color: #111827;
            letter-spacing: -0.02em;
        }
        .inv-doc-card-details-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 12px;
        }
        .inv-doc-card-details-title h2 {
            margin: 0;
            font-size: 15px;
            font-weight: 700;
            color: #111827;
        }
        .inv-doc-badge-e {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
            background: #ecfdf5;
            color: #047857;
            border: 1px solid #a7f3d0;
        }
        .inv-doc-kv-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 7px 0;
            font-size: 13px;
            line-height: 1.4;
        }
        .inv-doc-kv-row + .inv-doc-kv-row { border-top: 1px solid #f3f4f6; }
        .inv-doc-kv-row .k { color: #6b7280; flex-shrink: 0; }
        .inv-doc-kv-row .v {
            color: #111827;
            text-align: right;
            font-weight: 500;
        }
        .inv-doc-kv-row .v.muted { color: #9ca3af; font-weight: 400; }
        .inv-doc-kv-row .v.link {
            color: #5b84d1;
            cursor: pointer;
            font-weight: 500;
        }
        .inv-doc-linked-wrap { position: relative; display: inline-block; }
        .inv-doc-linked-popover {
            display: none;
            position: absolute;
            left: 0;
            top: calc(100% + 8px);
            z-index: 2100;
            min-width: 520px;
            max-width: min(640px, calc(100vw - 32px));
            background: #fff;
            border: 1px solid #d6dbe4;
            border-radius: 12px;
            box-shadow: 0 12px 32px rgba(16,24,40,.16);
            padding: 0 0 8px;
        }
        .inv-doc-linked-columns {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
        }
        .inv-doc-linked-col + .inv-doc-linked-col {
            border-left: 1px solid #eef2f7;
        }
        .inv-doc-linked-col-head {
            padding: 10px 14px 8px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #6b7280;
            background: #f9fafb;
            border-bottom: 1px solid #eef2f7;
        }
        .inv-doc-payment-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
        .inv-doc-payment-row {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 4px 12px;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
            font-size: 13px;
        }
        .inv-doc-payment-row:last-child { border-bottom: none; }
        .inv-doc-payment-row .pay-meta { grid-column: 1 / -1; font-size: 12px; color: #6b7280; }
        .inv-doc-card-payments h3 {
            margin: 0 0 10px;
            font-size: 13px;
            font-weight: 700;
            color: #374151;
        }
        .inv-doc-linked-popover.open { display: block; }
        .inv-doc-linked-popover-head {
            padding: 12px 16px 10px;
            font-size: 13px;
            font-weight: 700;
            color: #374151;
            border-bottom: 1px solid #eef2f7;
        }
        .inv-doc-linked-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 11px 16px;
            font-size: 13px;
            line-height: 1.35;
        }
        .inv-doc-linked-item + .inv-doc-linked-item { border-top: 1px solid #f3f4f6; }
        .inv-doc-linked-item .lbl { color: #111827; font-weight: 500; }
        .inv-doc-linked-item .meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
        .inv-doc-linked-item.missing .lbl { color: #9ca3af; font-weight: 400; }
        .inv-doc-linked-item a {
            color: #5b84d1;
            text-decoration: none;
            font-weight: 600;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .inv-doc-linked-item a:hover { text-decoration: underline; }
        .inv-doc-linked-status {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 999px;
            margin-top: 4px;
        }
        .inv-doc-linked-status.sent { background: #dcfce7; color: #166534; }
        .inv-doc-linked-status.draft { background: #f3f4f6; color: #6b7280; }
        .inv-doc-linked-status.none { background: #f9fafb; color: #9ca3af; }
        .inv-doc-lock-line {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .inv-doc-more-wrap { position: relative; display: inline-block; }
        .inv-doc-more-menu {
            position: absolute;
            right: 0;
            top: calc(100% + 6px);
            min-width: 220px;
            background: #fff;
            border: 1px solid #d6dbe4;
            border-radius: 12px;
            box-shadow: 0 10px 26px rgba(0,0,0,.14);
            z-index: 2000;
            padding: 6px 0;
            display: none;
        }
        .inv-doc-more-menu.open { display: block; }
        .inv-doc-more-menu button {
            display: block;
            width: 100%;
            text-align: left;
            padding: 10px 14px;
            border: none;
            background: none;
            font: inherit;
            font-size: 14px;
            cursor: pointer;
        }
        .inv-doc-more-menu button:hover { background: #f3f4f6; }
        .inv-doc-more-menu button.danger { color: #b91c1c; }
        .doc-send-modal .doc-send-dialog {
            width: min(1180px, calc(100vw - 32px));
            height: min(92vh, 920px);
            max-height: calc(100vh - 32px);
        }
        .doc-send-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 18px;
            border-bottom: 1px solid #e5e7eb;
            flex-shrink: 0;
        }
        .doc-send-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: #111827; }
        .doc-send-head-meta { font-size: 13px; color: #b91c1c; display: flex; align-items: center; gap: 6px; }
        .doc-send-body {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 320px;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }
        .doc-send-preview {
            display: flex;
            flex-direction: column;
            min-height: 0;
            background: #eef0f4;
            border-right: 1px solid #e5e7eb;
        }
        .doc-send-preview-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            background: #fff;
            border-bottom: 1px solid #d8dce3;
            font-size: 13px;
            color: #374151;
        }
        .doc-send-preview-frame.inv-doc-pdf-scroll {
            flex: 1;
            min-height: 0;
        }
        .doc-send-sidebar {
            overflow-y: auto;
            padding: 12px 14px 16px;
            background: #fff;
        }
        .doc-send-acc {
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            margin-bottom: 10px;
            overflow: hidden;
        }
        .doc-send-acc-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 12px 14px;
            cursor: pointer;
            background: #fff;
            font-size: 14px;
            font-weight: 600;
            color: #111827;
        }
        .doc-send-acc-head:hover { background: #f9fafb; }
        .doc-send-acc-head .left { display: flex; align-items: center; gap: 8px; }
        .doc-send-acc-body { display: none; padding: 0 14px 14px; }
        .doc-send-acc.open .doc-send-acc-body { display: block; }
        .doc-send-acc.open .doc-send-acc-caret { transform: rotate(90deg); }
        .doc-send-acc-caret { color: #6b7280; font-size: 12px; transition: transform .15s; }
        .doc-send-ehint {
            display: flex;
            gap: 10px;
            padding: 10px 12px;
            margin-bottom: 10px;
            border-radius: 8px;
            background: #ecfdf5;
            border: 1px solid #a7f3d0;
            font-size: 12px;
            line-height: 1.45;
            color: #065f46;
        }
        .doc-send-ehint strong { display: block; font-size: 13px; margin-bottom: 2px; }
        .doc-send-btn {
            display: block;
            width: 100%;
            margin-top: 8px;
            padding: 11px 14px;
            border-radius: 8px;
            font: inherit;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            box-sizing: border-box;
            text-align: center;
        }
        .doc-send-btn.primary { background: #1e293b; color: #fff; border: none; }
        .doc-send-btn.primary:hover { background: #0f172a; }
        .doc-send-btn.secondary { background: #fff; color: #111827; border: 1px solid #d1d5db; }
        .doc-send-btn.secondary:hover { background: #f9fafb; }
        .doc-send-btn:disabled { opacity: .45; cursor: not-allowed; }
        .doc-send-email-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
        .doc-send-email-body { padding: 16px 18px; overflow-y: auto; }
        .doc-send-email-body label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 6px; }
        .doc-send-email-body input,
        .doc-send-email-body textarea {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d6dbe4;
            border-radius: 8px;
            padding: 9px 11px;
            font: inherit;
            font-size: 14px;
            margin-bottom: 12px;
        }
        .doc-send-email-body textarea { min-height: 100px; resize: vertical; }
        .doc-send-email-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 18px;
            border-top: 1px solid #e5e7eb;
        }
        .beleg-sec { margin-bottom:4px; }
        .beleg-sec-head { display:flex; align-items:center; gap:8px; margin-bottom:14px; }
        .beleg-sec-head h2 { margin:0; font-size:18px; font-weight:700; color:#111827; flex:1; }
        .beleg-ai-btn {
            flex-shrink:0; width:36px; height:36px; padding:0;
            border:1px solid #c7d2fe; border-radius:10px;
            background:linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
            color:#4f46e5; cursor:pointer; font-size:18px; line-height:1;
            display:inline-flex; align-items:center; justify-content:center;
        }
        .beleg-ai-btn:hover:not(:disabled) { background:#e0e7ff; border-color:#a5b4fc; }
        .beleg-ai-btn:disabled { opacity:0.5; cursor:wait; }
        .staff-doc-ai-btn {
            flex-shrink:0; width:35px; height:35px; padding:0;
            border:1px solid #c7d2fe; border-radius:8px;
            background:linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
            color:#4f46e5; cursor:pointer; font-size:14px; line-height:1;
            display:inline-flex; align-items:center; justify-content:center;
        }
        .staff-doc-ai-btn:hover:not(:disabled) { background:#e0e7ff; border-color:#a5b4fc; }
        .staff-doc-ai-btn:disabled { opacity:0.5; cursor:wait; }
        .beleg-sec h2 { margin:0 0 14px 0; font-size:18px; font-weight:700; color:#111827; }
        .beleg-sec h3 { margin:24px 0 12px 0; font-size:17px; font-weight:700; color:#1e3a5f; }
        .beleg-sec label { display:block; font-size:13px; font-weight:600; color:#374151; margin:10px 0 4px; }
        .beleg-sec .req { color:#5b84d1; font-weight:700; }
        .beleg-typ-seg { display:inline-flex; background:#e8ecf2; border-radius:10px; padding:4px; gap:4px; margin-bottom:8px; }
        .beleg-typ-seg button { border:none; background:transparent; padding:9px 22px; border-radius:8px; font:inherit; font-weight:600; cursor:pointer; color:#6b7280; }
        .beleg-typ-seg button.active { background:#fff; color:#111827; box-shadow:0 1px 4px rgba(0,0,0,.08); }
        .beleg-sec input:not([type="radio"]):not([type="checkbox"]),
        .beleg-sec select, .beleg-sec textarea {
            width:100%; box-sizing:border-box; border:1px solid #d6dbe4; border-radius:10px; padding:10px 12px; font:inherit; font-size:15px; background:#fff;
        }
        .beleg-sec .beleg-position-card .inv-line-discount-combo input,
        .beleg-sec .beleg-position-card .inv-line-discount-combo select {
            border:0;
            border-radius:0;
            box-shadow:none;
            background:transparent;
        }
        .beleg-sec textarea { min-height:72px; resize:vertical; }
        .beleg-details-grid {
            display:grid;
            grid-template-columns:minmax(0,1fr) minmax(0,1fr);
            column-gap:20px;
            row-gap:14px;
            align-items:start;
        }
        .beleg-field { min-width:0; }
        .beleg-details-grid > .beleg-field > label,
        .beleg-details-grid > .beleg-field > .beleg-label-with-extra {
            margin-top:0;
            margin-bottom:4px;
        }
        .beleg-label-with-extra {
            display:flex;
            align-items:baseline;
            justify-content:space-between;
            gap:10px;
        }
        .beleg-label-with-extra label { margin:0 !important; flex:1; min-width:0; }
        .beleg-zeitraum-hint {
            border:none;
            background:transparent;
            padding:0;
            font:inherit;
            font-size:12px;
            font-weight:600;
            color:#6b7280;
            cursor:default;
            white-space:nowrap;
        }
        .beleg-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
        @media (max-width:720px) {
            .beleg-details-grid { grid-template-columns:1fr; }
            .beleg-row-2 { grid-template-columns:1fr; }
        }
        .beleg-search-wrap { position:relative; }
        .beleg-search-wrap .beleg-search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#9ca3af; pointer-events:none; font-size:16px; }
        .beleg-search-wrap input { padding-left:38px; }
        .beleg-label-row { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
        .beleg-label-row .beleg-field-toggle {
            border:1px solid #d8e0f4; background:#f3f6fd; color:#5b5ac8;
            font-size:13px; font-weight:600; cursor:pointer; padding:4px 10px; border-radius:8px;
        }
        .beleg-label-row .beleg-field-toggle:hover { background:#e8eeff; }
        .beleg-amount-group {
            display:flex;
            align-items:stretch;
            width:100%;
            border:1px solid #d6dbe4;
            border-radius:10px;
            overflow:hidden;
            background:#fff;
        }
        .beleg-amount-group .beleg-amt-input {
            flex:1;
            min-width:0;
            border:none !important;
            border-radius:0;
            box-shadow:none;
            font-size:15px;
            font-weight:600;
            text-align:right;
            padding:10px 12px;
        }
        .beleg-position-card .inv-line-discount-combo input {
            text-align:right;
            font-weight:600;
            font-size:15px;
        }
        .beleg-position-card .inv-line-discount-combo .beleg-amt-curr-label {
            display:flex;
            align-items:center;
            justify-content:center;
            min-width:48px;
            padding:8px 10px;
            font-size:14px;
            font-weight:600;
            color:#374151;
            border-left:1px solid #e5e9f0;
            box-sizing:border-box;
        }
        .beleg-kat-open {
            width:100%;
            box-sizing:border-box;
            text-align:left;
            border:1px solid #d6dbe4;
            border-radius:10px;
            padding:10px 12px;
            font:inherit;
            font-size:15px;
            background:#fff;
            cursor:pointer;
            color:#111827;
        }
        .beleg-kat-open:hover { border-color:#b8c0d0; background:#fafbfc; }
        .beleg-position-card {
            border:1px solid #e5e7eb;
            border-radius:12px;
            padding:14px 16px;
            margin-bottom:12px;
            background:#fff;
        }
        .beleg-position-head {
            display:flex;
            justify-content:space-between;
            align-items:center;
            margin-bottom:10px;
            font-size:15px;
            font-weight:600;
            color:#111827;
        }
        .beleg-position-head .beleg-position-sum { font-weight:700; color:#111827; text-align:right; }
        .beleg-position-sum-eur { white-space:nowrap; display:inline-block; }
        .beleg-position-head .beleg-position-sum .beleg-fx-subamount { display:block; margin-top:2px; font-weight:500; }
        .beleg-position-card .beleg-row-2 { margin-top:8px; }
        .beleg-position-remove {
            border:none;
            background:transparent;
            color:#9ca3af;
            font-size:18px;
            cursor:pointer;
            line-height:1;
            padding:0 4px;
        }
        .beleg-position-remove:hover { color:#dc2626; }
        .beleg-skr04-version-hint {
            font-size:13px;
            color:#92400e;
            background:#fffbeb;
            border:1px solid #fcd34d;
            border-radius:10px;
            padding:8px 10px;
            margin:0 0 10px 0;
        }
        .beleg-tags-fullwidth { grid-column:1 / -1; }
        .beleg-vat-treatment-wrap select { width:100%; box-sizing:border-box; }
        .beleg-vat-treatment-select-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .beleg-vat-treatment-select-row select { flex: 1; min-width: 0; }
        .beleg-vat-treatment-info {
            display: inline-flex;
            align-items: center;
            flex-shrink: 0;
        }
        .beleg-vat-treatment-info-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1px solid #9ca3af;
            color: #6b7280;
            font-size: 11px;
            font-weight: 600;
            font-style: italic;
            line-height: 1;
            cursor: help;
            background: #fff;
        }
        .beleg-vat-treatment-info-popover {
            display: none;
            margin-top: 8px;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            background: #fff;
            color: #374151;
            font-size: 13px;
            line-height: 1.5;
            white-space: pre-line;
            box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
        }
        .beleg-vat-treatment-wrap:has(#beleg-ig-erwerb-info:hover) .beleg-vat-treatment-info-popover:not(:empty),
        .beleg-vat-treatment-wrap:has(#beleg-ig-erwerb-info:focus-within) .beleg-vat-treatment-info-popover:not(:empty) {
            display: block;
        }
        .beleg-vat-treatment-hint {
            margin-top:10px;
            padding:10px 12px;
            border-radius:10px;
            border:1px solid #fcd34d;
            background:#fffbeb;
            color:#92400e;
            font-size:13px;
            line-height:1.45;
        }
        .beleg-vat-treatment-hint strong { display:block; margin-bottom:4px; color:#78350f; }
        .beleg-skr04-bookings {
            margin-top: 14px;
            padding: 14px 16px;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            background: #fff;
        }
        .beleg-skr04-bookings h3 {
            margin: 0 0 8px;
            font-size: 14px;
        }
        .beleg-field .inv-date-wrap input { width:100%; box-sizing:border-box; }
        .beleg-skr04-modal {
            position:fixed;
            inset:0;
            z-index:4000;
            display:none;
            align-items:center;
            justify-content:center;
            padding:16px;
            box-sizing:border-box;
        }
        .beleg-skr04-modal.open { display:flex; }
        .beleg-skr04-backdrop { position:absolute; inset:0; background:rgba(17,24,39,.45); }
        .beleg-skr04-dialog {
            position:relative;
            width:min(920px,calc(100vw - 32px));
            min-height:min(88vh,820px);
            max-height:min(88vh,820px);
            background:#fff;
            border-radius:14px;
            box-shadow:0 24px 48px rgba(0,0,0,.18);
            display:flex;
            flex-direction:column;
            overflow:hidden;
        }
        .beleg-skr04-head {
            flex-shrink:0;
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:12px;
            padding:14px 18px;
            border-bottom:1px solid #e5e7eb;
        }
        .beleg-skr04-head h2 { margin:0; font-size:18px; font-weight:700; color:#111827; }
        .beleg-skr04-head button.close {
            border:none;
            background:#f3f4f6;
            width:36px;
            height:36px;
            border-radius:50%;
            cursor:pointer;
            font-size:20px;
            line-height:1;
            color:#374151;
        }
        .beleg-skr04-search {
            flex-shrink:0;
            padding:10px 18px 12px;
            border-bottom:1px solid #e5e7eb;
        }
        .beleg-skr04-fetch-msg {
            flex-shrink:0;
            display:none;
            margin:0 18px 10px;
            padding:8px 12px;
            border-radius:8px;
            font-size:13px;
            line-height:1.4;
        }
        .beleg-skr04-fetch-msg--warn { background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }
        .beleg-skr04-fetch-msg--err { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
        .beleg-skr04-search .beleg-search-wrap input { width:100%; }
        .beleg-skr04-body {
            flex:1 1 auto;
            position:relative;
            overflow:hidden;
            min-height:min(420px,52vh);
            height:min(480px,calc(88vh - 200px));
            max-height:min(520px,calc(88vh - 160px));
        }
        @media (max-width:720px) {
            .beleg-skr04-body {
                display:flex;
                flex-direction:column;
                height:min(72vh,620px);
                max-height:min(72vh,620px);
            }
            .beleg-skr04-sidebar {
                position:relative !important;
                left:auto !important;
                top:auto !important;
                bottom:auto !important;
                width:100% !important;
                flex:0 0 auto;
                height:min(200px,36vh);
                max-height:240px;
                border-right:none;
                border-bottom:1px solid #e5e7eb;
            }
            .beleg-skr04-grid-wrap {
                position:relative !important;
                left:auto !important;
                top:auto !important;
                right:auto !important;
                bottom:auto !important;
                flex:1 1 auto;
                min-height:220px;
            }
        }
        .beleg-skr04-sidebar {
            position:absolute;
            left:0;
            top:0;
            bottom:0;
            width:220px;
            box-sizing:border-box;
            overflow-y:scroll;
            overflow-x:hidden;
            -webkit-overflow-scrolling:touch;
            scrollbar-gutter:stable;
            border-right:1px solid #e5e7eb;
            padding:8px 0;
            background:#fafbfc;
        }
        .beleg-skr04-sidebar::-webkit-scrollbar,
        .beleg-skr04-grid-wrap::-webkit-scrollbar { width:10px; height:10px; }
        .beleg-skr04-sidebar::-webkit-scrollbar-thumb,
        .beleg-skr04-grid-wrap::-webkit-scrollbar-thumb {
            background:#b8c2ce;
            border-radius:6px;
            border:2px solid transparent;
            background-clip:padding-box;
        }
        .beleg-skr04-navsec { padding:6px 12px 4px; font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.04em; }
        .beleg-skr04-navbtn {
            display:block;
            width:100%;
            text-align:left;
            border:none;
            background:transparent;
            padding:9px 14px;
            font:inherit;
            font-size:14px;
            color:#374151;
            cursor:pointer;
            border-left:3px solid transparent;
        }
        .beleg-skr04-navbtn:hover { background:#f3f4f6; }
        .beleg-skr04-navbtn.active { background:#eef2ff; border-left-color:#5b84d1; font-weight:600; color:#1e3a5f; }
        .beleg-skr04-grid-wrap {
            position:absolute;
            left:220px;
            top:0;
            right:0;
            bottom:0;
            box-sizing:border-box;
            overflow-y:scroll;
            overflow-x:hidden;
            -webkit-overflow-scrolling:touch;
            scrollbar-gutter:stable;
            padding:14px 16px;
            background:#fff;
        }
        .beleg-skr04-grid {
            display:grid;
            grid-template-columns:repeat(2,minmax(0,1fr));
            gap:12px;
        }
        @media (max-width:560px) { .beleg-skr04-grid { grid-template-columns:1fr; } }
        .beleg-skr04-card {
            border:1px solid #e5e7eb;
            border-radius:12px;
            padding:12px 14px;
            text-align:left;
            cursor:pointer;
            background:#fff;
            position:relative;
            transition:border-color .12s, box-shadow .12s;
        }
        .beleg-skr04-card:hover { border-color:#c7d2e4; box-shadow:0 2px 8px rgba(0,0,0,.06); }
        .beleg-skr04-card.selected { border-color:#5b84d1; box-shadow:0 0 0 1px #5b84d1; }
        .beleg-skr04-card .t { font-weight:700; font-size:14px; color:#111827; padding-right:22px; }
        .beleg-skr04-card .c { font-size:12px; color:#6b7280; margin-top:2px; }
        .beleg-skr04-card .d { font-size:12px; color:#6b7280; margin-top:8px; line-height:1.45; }
        .beleg-skr04-card .star { position:absolute; top:10px; right:10px; font-size:14px; color:#d1d5db; }
        .beleg-skr04-foot {
            flex-shrink:0;
            display:flex;
            justify-content:flex-end;
            gap:10px;
            padding:12px 18px;
            border-top:1px solid #e5e7eb;
            background:#fafbfc;
        }
        .beleg-hint-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:#e8ecf2; color:#6b7280; font-size:11px; font-weight:700; cursor:help; }
        .beleg-collapse { border:none; background:transparent; color:#5b84d1; font-size:13px; font-weight:600; cursor:pointer; padding:8px 0 0; margin-top:4px; }
        .beleg-status-line { font-size:14px; margin-top:12px; min-height:1.3em; color:#374151; }
        .beleg-status-line.ok { color:#166534; }
        .beleg-status-line.err { color:#b91c1c; }
        .inv-totals { margin-top:10px; }
        .inv-total-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; font-size:14px; color:#4b5563; }
        .inv-total-row + .inv-total-row { margin-top:6px; }
        .inv-total-row .v { margin-left:auto; min-width:110px; text-align:right; color:#111827; font-weight:700; }
        .inv-total-row.total { margin-top:8px; font-size:17px; font-weight:700; color:#111827; }
        .inv-total-row.total .v { font-size:17px; }
        .beleg-fx-subamount { display:block; font-size:12px; font-weight:500; color:#9ca3af; margin-top:2px; }
        .beleg-fx-rate-row { font-size:12px; color:#6b7280; margin-top:8px; padding-top:8px; border-top:1px solid #f3f4f6; }
        .inv-field-toggle { float:right; color:#5b5ac8; font-size:12px; font-weight:600; cursor:pointer; user-select:none; }
        .inv-inline-modal { position:fixed; right:0; top:0; background:#fff; border:1px solid #d6dbe4; border-radius:12px; box-shadow:0 10px 24px rgba(0,0,0,.14); padding:12px; width:320px; z-index:2600; display:none; }
        .inv-inline-modal.open { display:block; }
        .inv-range-picker { width:min(700px, calc(100vw - 36px)); right:auto; left:0; padding:0; overflow:hidden; }
        .inv-range-cal-head { display:grid; grid-template-columns: 1fr 1fr; gap:12px; padding:10px 12px 0; }
        .inv-range-cal-head .month-title { font-size:18px; font-weight:600; color:#111827; display:flex; align-items:center; justify-content:space-between; }
        .inv-range-cal-head button { border:none; background:transparent; cursor:pointer; font-size:22px; color:#374151; padding:0; }
        .inv-range-cal-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:6px 12px 12px; }
        .inv-range-cal-grid .inv-date-week, .inv-range-cal-grid .inv-date-days { gap:2px; }
        .inv-range-footer { display:flex; justify-content:flex-end; gap:10px; border-top:1px solid #edf1f5; padding:12px 16px; }
        @media (max-width: 1180px) {
            .acc-overview-actions { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
            .acc-overview-bottom-grid { grid-template-columns: 1fr; }
            .acc-overview-period-menu { width: min(700px, calc(100vw - 40px)); }
            .acc-overview-period-menu-grid { grid-template-columns: 1fr; }
            .acc-overview-period-quick { border-right: none; border-bottom: 1px solid #eef2f7; max-height: 180px; }
            .acc-overview-period-cal-grid { grid-template-columns: 1fr; }
            .acc-overview-period-cal-head { grid-template-columns: 1fr; }
            .acc-overview-period-month-title { font-size: 16px; }
            .inv-page-head { flex-direction:column; align-items:flex-start; }
            .inv-line-head,
            .inv-line-item { min-width: 0; }
            .inv-link-row { margin-left: 0; }
        }
        @media (max-width: 900px) {
            .inv-line-head {
                grid-template-columns: 14px minmax(240px, 2.8fr) 116px 124px 68px 96px 102px 36px;
                gap:6px;
            }
            .inv-line-item { grid-template-columns: 14px 1fr; gap:6px; }
            .inv-line-row {
                grid-template-columns: minmax(240px, 2.8fr) 116px 124px 68px 96px 102px 36px;
                gap:6px;
            }
            .inv-line-field > input,
            .inv-line-field > select,
            .inv-line-field > .inv-rec-suggest > input,
            .inv-line-qtyunit input,
            .inv-line-qtyunit select,
            .inv-line-discount-combo input,
            .inv-line-discount-combo select { font-size:14px; padding:8px 9px; }
            .inv-line-total { font-size:14px; }
            .inv-range-picker { width:min(640px, calc(100vw - 20px)); }
        }
        .inv-line-desc { display:none; }
        .inv-line-card:focus-within .inv-line-desc { display:block; }
        .inv-line-desc textarea {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d6dbe4;
            border-radius: 10px;
            padding: 10px 12px;
            font: inherit;
            font-size: 15px;
            line-height: 1.45;
            min-height: 72px;
            resize: vertical;
        }

        .rustdesk-dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
        @media (max-width: 960px) { .rustdesk-dash-grid { grid-template-columns: 1fr; } }
        .rustdesk-stat-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; position: relative; min-height: 92px; box-sizing: border-box; }
        .rustdesk-stat-card .rustdesk-stat-label { font-size: 13px; color: #666; margin: 0; }
        .rustdesk-stat-card .rustdesk-stat-value { font-size: 30px; font-weight: 700; margin: 10px 0 0 0; color: #111; }
        .rustdesk-stat-card .rustdesk-stat-icon { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; color: #fff; }
        .rustdesk-stat-card .ic-ws { background: #f5c84c; }
        .rustdesk-stat-card .ic-srv { background: #6bcf7a; }
        .rustdesk-stat-card .ic-tab { background: #e891c8; }
        .rustdesk-table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
        .rustdesk-table-toolbar h2 { margin: 0; font-size: 18px; font-weight: 500; }
        .rustdesk-count-input { width: 76px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
        .rustdesk-server-hint {
            background: #f8f9fc;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 14px 16px;
            margin: 0 0 16px 0;
            font-size: 14px;
            line-height: 1.55;
            color: #444;
        }
        .rustdesk-server-hint strong { color: #333; }
        .rustdesk-server-hint code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 13px;
            word-break: break-all;
            background: #fff;
            border: 1px solid #e8e8ef;
            padding: 2px 6px;
            border-radius: 4px;
        }
        tr.rustdesk-customer-row { cursor: pointer; }
        tr.rustdesk-customer-row:focus { outline: 2px solid #5d82d1; outline-offset: -2px; }
        #rustdesk-detail-device-rows tr { cursor: default; }
        .rmm-device-icon-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            font-size: 22px;
            line-height: 1;
        }
        .rmm-icon-badge {
            position: absolute;
            bottom: 0;
            right: -2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            font-size: 10px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            border: 1.5px solid #fff;
            box-shadow: 0 1px 2px rgba(0,0,0,.15);
        }
        .rmm-icon-badge-ok { background: #2e9b50; }
        .rmm-icon-badge-off { background: #d64545; }
        .rmm-status-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            font-size: 15px;
            font-weight: 700;
            line-height: 1;
        }
        .rmm-status-icon-ok { background: #e8f6ec; color: #2e9b50; }
        .rmm-status-icon-pending { background: #fdecec; color: #d64545; }
        .rmm-status-icon-unknown { background: #f2f4f7; color: #8a94a3; font-size: 13px; }
        .rmm-status-icon-na { background: transparent; color: #b0b8c4; font-size: 16px; }
        .rmm-devices-table-wrap {
            width: 100%;
            overflow-x: hidden;
        }
        .rmm-devices-table {
            table-layout: fixed;
            width: 100%;
        }
        .rmm-devices-table .rmm-col-icon { width: 52px; }
        .rmm-devices-table .rmm-col-type { width: 14%; }
        .rmm-devices-table .rmm-col-name { width: 15%; }
        .rmm-devices-table .rmm-col-desc { width: 14%; }
        .rmm-devices-table .rmm-col-user { width: 11%; }
        .rmm-devices-table .rmm-col-agent { width: 7%; }
        .rmm-devices-table .rmm-col-patch { width: 6%; }
        .rmm-devices-table .rmm-col-actions { width: 22%; }
        .rmm-devices-table .rmm-icon-cell {
            text-align: center;
            width: 52px;
            min-width: 52px;
            max-width: 52px;
            padding-left: 6px;
            padding-right: 6px;
            overflow: visible;
        }
        .rmm-devices-table .rmm-icon-cell .rmm-device-icon-wrap {
            margin: 0 auto;
        }
        .rmm-devices-table th.rmm-patch-head,
        .rmm-devices-table .rmm-patch-cell {
            text-align: center;
            padding-left: 6px;
            padding-right: 18px;
        }
        .rmm-devices-table th.rmm-actions-head,
        .rmm-devices-table td.rmm-actions-cell {
            text-align: left;
            padding-left: 18px;
            padding-right: 12px;
            vertical-align: middle;
        }
        .rmm-devices-table tbody td {
            height: auto;
            min-height: 52px;
            padding-top: 8px;
            padding-bottom: 8px;
            vertical-align: middle;
            overflow: hidden;
        }
        .rmm-devices-table .rmm-device-type-select {
            width: 100%;
            max-width: none;
            box-sizing: border-box;
            border: 1px solid #d6dbe4;
            border-radius: 8px;
            padding: 5px 8px;
            font: inherit;
            font-size: 12px;
            background: #fff;
        }
        .rmm-devices-table .rmm-col-type .td-subtext {
            margin-top: 4px;
            font-size: 11px;
            line-height: 1.25;
            white-space: normal;
        }
        .rmm-devices-table td.rmm-desc-cell {
            vertical-align: middle;
            overflow: visible;
        }
        .rmm-devices-table .rmm-device-desc-input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d6dbe4;
            border-radius: 8px;
            padding: 5px 8px;
            font: inherit;
            font-size: 12px;
            line-height: 1.35;
            min-height: 34px;
            resize: none;
            overflow: hidden;
        }
        .rmm-devices-table .rmm-col-name,
        .rmm-devices-table .rmm-col-user {
            font-size: 13px;
            word-break: break-word;
        }
        .rmm-devices-table .rmm-col-agent {
            font-size: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .rmm-actions-row {
            display: inline-flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            flex-wrap: nowrap;
            max-width: 100%;
        }
        .rmm-actions-row .rmm-action-btn {
            height: 32px;
            min-height: 32px;
            padding: 0 10px;
            margin: 0;
            font-size: 12px;
            line-height: 1;
            border-radius: 6px;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            flex: 0 0 auto;
        }
        .rmm-tac-control-btn {
            background: #1565c0;
            border: none;
            color: #fff;
        }
        .rmm-rustdesk-connect-btn {
            background: #6a1b9a;
            border: none;
            color: #fff;
        }
        .rmm-rustdesk-connect-btn:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }
        .rmm-rustdesk-eye-btn {
            width: 32px;
            min-width: 32px;
            padding: 0;
            border: 1px solid #d6dbe4;
            background: #fff;
            color: #5d6573;
            cursor: pointer;
        }
        .rmm-rustdesk-eye-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .rmm-rustdesk-eye-btn.is-viewed {
            border-color: #f59e0b;
            color: #b45309;
            background: #fffbeb;
        }
        .rmm-rustdesk-eye-btn svg { width: 16px; height: 16px; display: block; }
        .rmm-rustdesk-pwd-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.45);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 12000;
            padding: 16px;
        }
        .rmm-rustdesk-pwd-dialog {
            width: min(480px, 100%);
            background: #fff;
            border-radius: 12px;
            padding: 20px 22px;
            box-shadow: 0 18px 48px rgba(0,0,0,0.18);
        }
        .rmm-rustdesk-pwd-dialog h3 { margin: 0 0 8px; font-size: 18px; }
        .rmm-rustdesk-pwd-value {
            display: block;
            width: 100%;
            margin: 12px 0;
            padding: 12px 14px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 18px;
            letter-spacing: 0.04em;
            word-break: break-all;
            text-align: left;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .rmm-rustdesk-pwd-value:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }
        .rmm-rustdesk-pwd-value:focus {
            outline: 2px solid #5d82d1;
            outline-offset: 2px;
        }
        .rmm-rustdesk-pwd-value.is-copied {
            background: #ecfdf5;
            border-color: #34d399;
            box-shadow: inset 0 0 0 1px #a7f3d0;
        }
        .rmm-rustdesk-pwd-value code {
            display: block;
            font-size: 18px;
            color: #0f172a;
        }
        .rmm-rustdesk-pwd-copy-hint {
            display: block;
            margin-top: 8px;
            font-size: 12px;
            font-weight: 600;
            color: #64748b;
            letter-spacing: normal;
        }
        .rmm-rustdesk-pwd-value.is-copied .rmm-rustdesk-pwd-copy-hint {
            color: #047857;
        }
        .rmm-rustdesk-pwd-hint { font-size: 13px; color: #64748b; margin: 0; line-height: 1.45; }
        .rmm-rustdesk-pwd-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 14px;
        }

        .modal { display: none; position: fixed; z-index: 1600; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); }
        #crm-phonebook-modal.modal { display: none; align-items: center; justify-content: center; }
        #crm-customer-product-picker-modal.modal { display: none; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
        .modal-content { background: white; margin: 5% auto; width: 600px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); overflow: hidden;}
        #profile-modal {
            align-items: center; justify-content: center; padding: 20px; box-sizing: border-box;
            overflow: hidden; max-height: 100vh;
        }
        #profile-modal .modal-content {
            width: min(960px, calc(100vw - 40px)); max-width: none; margin: auto;
            display: flex; flex-direction: column; overflow: visible;
            max-height: none;
        }
        #profile-modal .modal-body {
            overflow: visible; flex: 0 1 auto; min-height: 0;
            padding: 14px 22px 18px;
        }
        #profile-modal .modal-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 12px 22px; background: #fafafa; }
        #profile-modal .modal-grid.profile-account-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px 18px;
            align-items: start;
        }
        #profile-modal .modal-grid.profile-account-grid .full { grid-column: 1 / -1; }
        #profile-modal .password-hint { font-size: 11px; margin: 2px 0 4px; color: var(--text-light); }
        #profile-modal #profile-password-inline-status {
            font-size: 12px; line-height: 1.35; color: var(--text-light); margin-top: 4px;
        }
        @media (max-width: 720px) {
            #profile-modal .modal-grid.profile-account-grid { grid-template-columns: 1fr 1fr; }
        }
        #org-staff-modal .modal-content {
            width: min(920px, calc(100vw - 32px));
            max-width: none;
            max-height: min(92vh, 900px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #org-staff-modal .modal-header { flex-shrink: 0; }
        #org-staff-modal .modal-body { padding: 14px 20px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
        #org-staff-modal .modal-footer { flex-shrink: 0; }
        #org-staff-modal .org-staff-grid {
            display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px;
        }
        #org-staff-modal .org-staff-grid .full { grid-column: 1 / -1; }
        @media (max-width: 640px) { #org-staff-modal .org-staff-grid { grid-template-columns: 1fr 1fr; } }
        .my-co-tab {
            padding: 8px 14px; border: none; background: transparent; cursor: pointer;
            font-size: 14px; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -1px;
        }
        .my-co-tab.active { color: var(--text); font-weight: 600; border-bottom-color: #3949ab; }
        .my-co-roles-panel { font-size: 14px; line-height: 1.55; color: #374151; max-width: 100%; }
        .my-co-roles-panel h4 { margin: 14px 0 6px; font-size: 14px; }
        .my-co-roles-panel ul { margin: 0 0 10px 18px; padding: 0; }
        .role-nav-matrix-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
        .role-nav-matrix { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 760px; }
        .role-nav-matrix th, .role-nav-matrix td { border-bottom: 1px solid #eef0f3; padding: 10px 8px; text-align: center; vertical-align: middle; }
        .role-nav-matrix thead th { background: #f9fafb; font-weight: 600; font-size: 12px; color: #374151; }
        .role-nav-matrix th.row-head, .role-nav-matrix td.row-head { text-align: left; white-space: nowrap; background: #fafafa; font-weight: 600; position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 #eef0f3; }
        .role-nav-matrix input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.55; }
        #time-entry-journal-modal { align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
        #time-entry-journal-modal .modal-content { margin: 0; max-width: 560px; width: 100%; max-height: min(90vh, 700px); display: flex; flex-direction: column; overflow: hidden; }
        #time-entry-journal-modal .modal-body { overflow-y: auto; flex: 1; min-height: 0; }
        .time-entry-audit-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: #eef2ff; color: #3949ab; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; }
        .time-entry-audit-ic:hover { background: #e0e7ff; }
        .time-bezug-cell { vertical-align: top; max-width: 360px; }
        .time-bezug-line { display: block; font-size: 13px; line-height: 1.45; padding: 6px 0; border-bottom: 1px solid #eef0f3; }
        .time-bezug-line:last-child { border-bottom: none; padding-bottom: 0; }
        .time-bezug-line:first-child { padding-top: 0; }
        .ts-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
        .ts-toolbar-mid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .ts-jibble-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
        .ts-jibble { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
        .ts-jibble th, .ts-jibble td { padding: 10px 8px; text-align: center; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
        .ts-jibble th { background: #fafbfc; font-weight: 600; }
        .ts-jibble th.ts-name-col, .ts-jibble td.ts-name-col { text-align: left; min-width: 200px; }
        .ts-dow { font-size: 11px; color: #6b7280; display: block; }
        .ts-dnum { font-size: 13px; font-weight: 600; }
        .ts-hol { font-size: 10px; color: #6b7280; font-weight: 500; margin-top: 2px; }
        .ts-av { width: 32px; height: 32px; border-radius: 50%; background: #e8ecf1; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #374151; margin-right: 8px; flex-shrink: 0; }
        .ts-namecell { display: flex; align-items: center; }
        .ts-search { max-width: 220px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
        .ts-cell-hol { background: #f3f4f6 !important; color: #6b7280; }
        #time-clock-out-modal { align-items: flex-start; justify-content: center; overflow: hidden; padding: 10px; box-sizing: border-box; }
        #time-clock-out-modal .modal-content {
            margin: 12px auto;
            max-width: min(720px, 98vw);
            width: 100%;
            max-height: min(92vh, 900px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #time-clock-out-modal .modal-header { padding: 14px 18px; flex-shrink: 0; }
        #time-clock-out-modal .modal-body { padding: 14px 18px; overflow-y: auto; flex: 1; min-height: 0; }
        #time-clock-out-modal .modal-footer { padding: 12px 18px; flex-shrink: 0; }
        #time-co-step-1 .modal-grid { align-items: start; }
        #time-co-end-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        @media (max-width: 520px) { #time-co-end-row { grid-template-columns: 1fr; } }
        .modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
        .modal-header h2 { margin: 0; font-size: 18px; font-weight: 500; }
        .modal-body { padding: 20px; }
        .modal-footer { padding: 15px 20px; border-top: 1px solid var(--border); text-align: right; background: #fcfcfc; }
        
        .modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .modal-grid .full { grid-column: span 2; }
        label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; font-weight: 500; }
        input, select, textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; font-family: inherit; }
        textarea { resize: vertical; min-height: 120px; }
        input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-color); }
        /* Menge / Rabatt: ein Rahmen, zwei Spalten — nach .inv-create-sec + globalen input-Regeln */
        .inv-line-qtyunit,
        .inv-line-discount-combo,
        .beleg-position-card .inv-line-discount-combo {
            display:grid;
            grid-template-columns:1fr auto;
            width:100%;
            box-sizing:border-box;
            border:1px solid #d6dbe4;
            border-radius:10px;
            background:#fff;
            overflow:hidden;
        }
        .inv-line-qtyunit:focus-within,
        .inv-line-discount-combo:focus-within,
        .beleg-position-card .inv-line-discount-combo:focus-within { border-color:#9fb5e8; }
        .inv-create-sec .inv-line-field .inv-line-qtyunit input,
        .inv-create-sec .inv-line-field .inv-line-qtyunit select,
        .inv-create-sec .inv-line-field .inv-line-discount-combo input,
        .inv-create-sec .inv-line-field .inv-line-discount-combo select,
        .inv-line-field .inv-line-qtyunit input,
        .inv-line-field .inv-line-qtyunit select,
        .inv-line-field .inv-line-discount-combo input,
        .inv-line-field .inv-line-discount-combo select,
        .beleg-position-card .inv-line-discount-combo input,
        .beleg-position-card .inv-line-discount-combo select {
            width:100%;
            box-sizing:border-box;
            margin:0;
            border:0;
            border-radius:0;
            outline:none;
            box-shadow:none;
            padding:8px 10px;
            font:inherit;
            font-size:14px;
            background:transparent;
            appearance:none;
            -moz-appearance:textfield;
        }
        .inv-create-sec .inv-line-field .inv-line-qtyunit input:focus,
        .inv-create-sec .inv-line-field .inv-line-qtyunit select:focus,
        .inv-create-sec .inv-line-field .inv-line-discount-combo input:focus,
        .inv-create-sec .inv-line-field .inv-line-discount-combo select:focus,
        .inv-line-field .inv-line-qtyunit input:focus,
        .inv-line-field .inv-line-qtyunit select:focus,
        .inv-line-field .inv-line-discount-combo input:focus,
        .inv-line-field .inv-line-discount-combo select:focus,
        .beleg-position-card .inv-line-discount-combo input:focus,
        .beleg-position-card .inv-line-discount-combo select:focus {
            border:0;
            outline:none;
            box-shadow:none;
        }
        .inv-line-qtyunit input::-webkit-outer-spin-button,
        .inv-line-qtyunit input::-webkit-inner-spin-button,
        .inv-line-discount-combo input::-webkit-outer-spin-button,
        .inv-line-discount-combo input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
        .inv-create-sec .inv-line-field .inv-line-qtyunit select,
        .inv-create-sec .inv-line-field .inv-line-discount-combo select,
        .inv-line-field .inv-line-qtyunit select,
        .inv-line-field .inv-line-discount-combo select,
        .beleg-position-card .inv-line-discount-combo select {
            width:auto;
            min-width:48px;
            padding-left:8px;
            padding-right:24px;
            text-align:center;
            cursor:pointer;
            border:0;
            border-left:1px solid #e5e9f0;
            background:#f8fafc;
        }
        .inv-create-sec .inv-line-field .inv-line-qtyunit select:focus,
        .inv-create-sec .inv-line-field .inv-line-discount-combo select:focus,
        .inv-line-field .inv-line-qtyunit select:focus,
        .inv-line-field .inv-line-discount-combo select:focus,
        .beleg-position-card .inv-line-discount-combo select:focus { border:0; border-left:1px solid #e5e9f0; }
        .inv-line-qtyunit select { min-width:68px; }
        .auth-gate { position: fixed; inset: 0; background: rgba(248,249,250,0.98); z-index: 2000; display: flex; align-items: center; justify-content: center; }
        /* Ohne gültige Anmeldung keine App-UI — auch wenn JS später fehlschlägt */
        body:not(.app-authed) nav,
        body:not(.app-authed) #top-userbar,
        body:not(.app-authed) #main-content,
        body:not(.app-authed) #nav-user-menu { display: none !important; }
        body.app-authed #auth-gate { display: none !important; }
        html.sso-redirect-pending #auth-gate-sso .auth-actions,
        html.sso-redirect-pending #auth-gate-sso .auth-subtitle:not(#auth-gate-redirect-msg) { display: none !important; }
        html.sso-redirect-pending #auth-gate-redirect-msg { display: block !important; }
        #auth-gate-redirect-msg { display: none; margin: 12px 0 0; text-align: center; color: #555; }
        .auth-card { width: 380px; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
        .auth-title { margin: 0 0 8px 0; font-size: 22px; }
        .auth-subtitle { color: #666; font-size: 14px; margin: 0 0 16px 0; }
        .auth-row { margin-bottom: 12px; }
        .auth-actions { display: flex; gap: 10px; margin-top: 10px; }
        .auth-status { margin-top: 10px; color: #444; font-size: 13px; min-height: 18px; }
        .auth-status.auth-error { color: #b42318; font-weight: 500; }
        .auth-status.auth-success { color: #1b7f3b; font-weight: 500; }
        /* top-userbar = jibble-app-top (s. oben) */
        .impersonation-badge { display: none; background: #b42318; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 4px 8px; letter-spacing: .02em; }
        .profile-status { margin-top: 10px; color: #444; font-size: 13px; min-height: 18px; }
        .password-hint { margin-top: 6px; color: #666; font-size: 12px; }
        .password-checklist { margin-top: 8px; font-size: 12px; color: #666; }
        .password-checklist .rule { margin: 4px 0; }
        .password-checklist .ok { color: #1b7f3b; }
        .password-checklist .pending { color: #888; }
        .crm-toolbar { padding: 10px 12px; margin-bottom: 8px; }
        .crm-toolbar .tab-bar { margin: 0; padding: 0; border-bottom: none; }
        .crm-toolbar .search-input { width: 240px; border-radius: 8px; }
        .crm-section { padding: 20px; }
        .crm-section h3 { margin: 0 0 14px 0; font-size: 16px; }
        .rmm-remote-access-options { display: flex; flex-direction: column; gap: 10px; }
        .rmm-remote-access-option {
            display: grid;
            grid-template-columns: 20px minmax(0, 1fr);
            column-gap: 14px;
            align-items: center;
            margin: 0;
        }
        .rmm-remote-access-radio-cell { display: flex; align-items: center; justify-content: flex-start; margin: 0; cursor: pointer; }
        .rmm-remote-access-text-cell { text-align: left; margin: 0; cursor: pointer; line-height: 1.4; }
        .rmm-remote-access-text-with-code {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px 12px;
        }
        .rmm-remote-access-code-inline input {
            width: 0;
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
            padding: 0;
            margin: 0;
            border-width: 0;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: width 0.15s ease, padding 0.15s ease, opacity 0.15s ease;
        }
        .rmm-remote-access-code-inline.is-visible input {
            width: 220px;
            padding: 8px;
            border-width: 1px;
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        .rmm-pending-requests-table { font-size: 13px; width: auto; max-width: 100%; }
        .rmm-pending-requests-table th,
        .rmm-pending-requests-table td { text-align: left; }
        .customer-portal-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
        .customer-portal-section-head h3 { margin: 0; }
        #customer-portal-docs-modal.modal { display: none; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
        #customer-portal-docs-modal .modal-content { margin: 0; width: min(920px, calc(100vw - 40px)); max-height: min(90vh, 800px); display: flex; flex-direction: column; overflow: hidden; }
        #customer-portal-docs-modal .modal-body { overflow-y: auto; flex: 1; min-height: 0; padding-top: 12px; }
        .customer-portal-docs-filter { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 14px; }
        .customer-portal-file-table { width: 100%; table-layout: fixed; }
        .customer-portal-file-table th,
        .customer-portal-file-table td { text-align: left; vertical-align: middle; }
        .customer-portal-file-table .col-download { width: 110px; }
        .customer-portal-file-table .col-status { width: 72px; text-align: center; }
        .customer-portal-file-table .col-date { width: 120px; }
        .customer-portal-file-table .col-money { width: 110px; }
        .customer-portal-dl { display: inline-block; min-width: 72px; }
        .quote-status-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; font-weight: 700; line-height: 1; }
        .quote-status-accepted { background: #dcfce7; color: #15803d; }
        .quote-status-rejected { background: #fee2e2; color: #b91c1c; }
        .crm-table { border-radius: 10px; overflow: hidden; }
        .crm-table thead th { background: #f3f5f8; font-size: 12px; font-weight: 600; color: #5f6b7a; text-transform: uppercase; letter-spacing: .02em; }
        .crm-table tbody tr { box-shadow: inset 0 -1px 0 #f0f0f0; }
        .crm-table tbody tr:last-child { box-shadow: none; }
        .crm-table tbody td { vertical-align: middle; border-bottom: none; height: 56px; box-sizing: border-box; }
        .crm-table tbody tr { cursor: pointer; }
        .tasks-dash-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
        .tasks-dash-head h1 { margin: 0; font-size: 17px; font-weight: 600; color: #111827; }
        .tasks-dash-head .btn-group { flex-shrink: 0; }
        @media (max-width: 640px) {
            .tasks-dash-head { flex-direction: column; align-items: stretch; }
            .tasks-dash-head .btn-group .btn { width: 100%; box-sizing: border-box; }
        }
        .task-modal-checklist-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .task-modal-checklist-ring {
            flex-shrink: 0;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 2px solid #cbd5e1;
            background: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            transition: border-color 0.12s ease, background 0.12s ease;
        }
        .task-modal-checklist-ring:hover {
            border-color: #94a3b8;
        }
        .task-modal-checklist-ring.is-done {
            background: #22c55e;
            border-color: #16a34a;
            color: #fff;
        }
        .task-modal-checklist-ring.is-done::before {
            content: '✓';
            font-size: 11px;
            font-weight: 800;
            line-height: 1;
        }
        .task-modal-checklist-done {
            text-decoration: line-through;
            color: #94a3af !important;
        }
        .task-modal-checklist-input {
            flex: 1;
            border: none;
            border-bottom: 1px solid #e5e7eb;
            padding: 6px 4px;
            font-size: 14px;
            outline: none;
            font-family: inherit;
        }
        .task-modal-checklist-input:focus { border-bottom-color: #cbd5e1; }

        .task-modal-m365 { width: min(720px, 96vw); max-height: min(92vh, 880px); display: flex; flex-direction: column; }
        .task-modal-m365 .modal-body { overflow-y: auto; flex: 1; min-height: 0; }
        .ticket-detail-modal-panel { width: min(720px, 96vw); max-height: min(92vh, 880px); display: flex; flex-direction: column; }
        .ticket-detail-modal-panel .modal-body { overflow-y: auto; flex: 1; min-height: 0; }
        .task-modal-crumb { font-size: 12px; font-weight: 600; color: #5d82d1; letter-spacing: .02em; }
        .task-modal-title-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
        .task-modal-check-ring {
            flex-shrink: 0;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 2px solid #cbd5e1;
            margin-top: 6px;
            background: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            transition: border-color 0.12s ease, background 0.12s ease;
        }
        .task-modal-check-ring:hover {
            border-color: #94a3b8;
        }
        .task-modal-check-ring.is-done {
            background: #22c55e;
            border-color: #16a34a;
            color: #fff;
        }
        .task-modal-check-ring.is-done::before {
            content: '✓';
            font-size: 13px;
            font-weight: 800;
            line-height: 1;
        }
        .task-modal-check-ring--disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }
        .task-modal-title-input.task-modal-title-done {
            text-decoration: line-through;
            color: #94a3b8 !important;
        }
        .task-modal-title-input {
            flex: 1;
            border: none;
            border-bottom: 1px solid transparent;
            font-size: 22px;
            font-weight: 700;
            color: #111827;
            padding: 6px 2px;
            outline: none;
            font-family: inherit;
            box-sizing: border-box;
        }
        .task-modal-title-input:focus { border-bottom-color: #cbd5e1; }
        .task-modal-assign-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
        .task-modal-assign-label { font-size: 13px; color: #6b7280; margin-right: 4px; }
        .task-modal-assign-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
        .task-modal-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: #5d82d1;
            color: #fff;
            font-size: 13px;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .task-modal-assign-select {
            flex: 1;
            min-width: 160px;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            font-family: inherit;
            font-size: 14px;
            background: #fff;
            box-sizing: border-box;
        }
        .task-modal-grid-m365 {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px 14px;
            margin-bottom: 18px;
        }
        @media (max-width: 720px) {
            .task-modal-grid-m365 { grid-template-columns: 1fr; }
        }
        .task-modal-field label {
            display: block;
            font-size: 11px;
            font-weight: 600;
            color: #6b7280;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: .03em;
        }
        .task-modal-field select,
        .task-modal-field input[type="date"] {
            width: 100%;
            box-sizing: border-box;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            font-family: inherit;
            font-size: 14px;
            background: #fff;
        }
        .task-modal-field-muted { opacity: 0.65; }
        .task-modal-notes-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            font-size: 14px;
            font-weight: 700;
            color: #111827;
        }
        .task-modal-notes-area {
            width: 100%;
            min-height: 140px;
            box-sizing: border-box;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            font-family: inherit;
            font-size: 14px;
            line-height: 1.45;
            white-space: pre-wrap;
            word-break: break-word;
            outline: none;
            background: #fff;
            overflow-y: auto;
        }
        .task-modal-notes-area:focus {
            border-color: #cbd5e1;
            box-shadow: 0 0 0 2px rgba(93, 130, 209, 0.2);
        }
        .task-modal-notes-area a.task-modal-notes-link {
            color: #2563eb;
            text-decoration: underline;
            text-underline-offset: 2px;
            cursor: pointer;
        }
        .task-modal-notes-area a.task-modal-notes-link:hover {
            color: #1d4ed8;
        }
        .task-modal-notes-area:empty::before {
            content: attr(data-placeholder);
            color: #9ca3af;
            pointer-events: none;
        }
        .tasks-dash-kanban-cols {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
            align-items: start;
        }
        @media (max-width: 900px) {
            .tasks-dash-kanban-cols { grid-template-columns: 1fr; }
        }
        .tickets-dash-kanban-cols {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 16px;
            align-items: start;
        }
        @media (max-width: 1100px) {
            .tickets-dash-kanban-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        @media (max-width: 900px) {
            .tickets-dash-kanban-cols { grid-template-columns: 1fr; }
        }
        .kanban-done-head-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .kanban-done-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            font: inherit;
            color: inherit;
            text-align: left;
        }
        .kanban-done-chevron {
            font-size: 12px;
            color: #9ca3af;
            width: 18px;
            display: inline-flex;
            justify-content: center;
        }
        .kanban-done-badge {
            background: #e5e7eb;
            color: #374151;
            border-radius: 999px;
            padding: 2px 10px;
            font-size: 13px;
            font-weight: 600;
            min-width: 22px;
            text-align: center;
        }
        .kanban-done-archive-btn {
            padding: 6px 10px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            background: #fff;
            cursor: pointer;
            font-size: 15px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .kanban-done-archive-btn:hover {
            background: #f9fafb;
            border-color: #d1d5db;
        }
        .kanban-task-card-done {
            cursor: grab;
            border-color: #e5e7eb !important;
            background: #fafafa !important;
        }
        .kanban-task-done-row {
            display: flex;
            gap: 10px;
            align-items: flex-start;
        }
        .kanban-task-done-check {
            flex-shrink: 0;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #5d82d1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            margin-top: 2px;
        }
        .kanban-task-done-title {
            text-decoration: line-through;
            color: #6b7280 !important;
            font-weight: 600 !important;
        }
        .kanban-task-done-num {
            font-size: 12px;
            color: #9ca3af !important;
        }
        #task-archive-modal .crm-table {
            font-size: 13px;
        }
        .task-modal-att-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
        }
        .task-modal-att-thumb {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
            border-radius: 6px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
            background: #f9fafb;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            color: #64748b;
        }
        .task-modal-att-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .task-modal-att-thumb-wrap {
            position: relative;
            flex-shrink: 0;
            width: 48px;
            height: 48px;
        }
        .task-modal-att-thumb-wrap .task-modal-att-thumb {
            width: 100%;
            height: 100%;
        }
        .task-modal-att-thumb-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 20px;
            height: 20px;
            border: none;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.62);
            color: #fff;
            font-size: 15px;
            line-height: 1;
            padding: 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.12s ease, background 0.12s ease;
            z-index: 2;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
        }
        .task-modal-att-thumb-wrap:hover .task-modal-att-thumb-remove {
            opacity: 1;
            pointer-events: auto;
        }
        .task-modal-att-thumb-remove:hover {
            background: #b91c1c;
        }
        .task-modal-att-thumb-remove:focus-visible {
            opacity: 1;
            pointer-events: auto;
            outline: 2px solid #5d82d1;
            outline-offset: 1px;
        }
        .crm-table tbody tr.selected { background: #eef4ff; }
        .crm-table tbody tr.selected:hover { background: #e9f1ff; }
        .crm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
        .crm-actions .btn { border-radius: 8px; padding: 7px 12px; }
        .crm-btn-danger { background: #fff; color: #a13a3a; border-color: #e7c6c6; }
        .crm-subtle { color: #6f7b8a; font-size: 12px; }
        .crm-product-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
        .crm-ind-ok { color: #2e7d32; font-weight: 700; }
        .crm-ind-no { color: #c14949; font-weight: 700; }

        .crm-kontakte-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
        .crm-kontakte-head h1 { margin: 0; font-size: 17px; font-weight: 600; color: #111827; }
        .crm-kontakte-subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid #e5e7eb; margin-bottom: 8px; }
        .crm-kontakte-subtab { padding: 6px 10px; cursor: pointer; border: none; background: none; font-size: 13px; color: #9ca3af; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
        .crm-kontakte-subtab:hover { color: #6b7280; }
        .crm-kontakte-subtab.active { color: #111827; font-weight: 700; border-bottom-color: #e74c3c; }
        .crm-kontakte-toolbar-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
        .crm-kontakte-util { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
        .crm-kontakte-typ-cell { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #374151; }
        .crm-kontakte-typ-ico { font-size: 15px; line-height: 1; }
        .crm-kontakte-ort-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; font-size: 13px; line-height: 1.35; }
        .crm-kontakte-del-wrap {
            width: 38px;
            text-align: center;
            vertical-align: middle;
            opacity: 0;
            transition: opacity 0.12s ease;
            cursor: pointer;
            font-size: 16px;
            user-select: none;
            color: #9ca3af;
        }
        .crm-table tbody tr:hover .crm-kontakte-del-wrap { opacity: 1; }
        .crm-kontakte-del-wrap:hover { color: #c14949; }
        .crm-kontakte-typ-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #fff; }
        .crm-kontakte-typ-badge.k { background: #5d82d1; }
        .crm-kontakte-typ-badge.l { background: #e24c4c; }
        .crm-phonebook-btn {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            background: #fff;
            color: #374151;
            cursor: pointer;
            padding: 0;
        }
        .crm-phonebook-btn:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
        .crm-phonebook-badge {
            position: absolute;
            top: -6px;
            right: -6px;
            min-width: 16px;
            height: 16px;
            padding: 0 4px;
            border-radius: 999px;
            background: #2563eb;
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            line-height: 16px;
            text-align: center;
        }
        #crm-phonebook-modal .crm-phonebook-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 16px;
            max-height: 320px;
            overflow: auto;
        }
        #crm-phonebook-modal .crm-phonebook-item {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px 12px;
            padding: 10px 12px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #fafafa;
        }
        #crm-phonebook-modal .crm-phonebook-item-name {
            font-weight: 600;
            color: #111827;
        }
        #crm-phonebook-modal .crm-phonebook-item-meta {
            font-size: 13px;
            color: #4b5563;
            line-height: 1.45;
        }
        #crm-phonebook-modal .crm-phonebook-item-actions {
            display: flex;
            gap: 6px;
            align-items: flex-start;
        }
        #crm-phonebook-modal .crm-phonebook-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        #crm-phonebook-modal .crm-phonebook-form-grid .auth-row { margin: 0; }
        @media (max-width: 640px) {
            #crm-phonebook-modal .crm-phonebook-form-grid { grid-template-columns: 1fr; }
        }

        button.crm-th-filtertoggle {
            border: none;
            background: transparent;
            font: inherit;
            font-size: 12px;
            font-weight: 600;
            color: #5f6b7a;
            text-transform: uppercase;
            letter-spacing: .02em;
            cursor: pointer;
            padding: 6px 4px;
            width: 100%;
            text-align: left;
            box-sizing: border-box;
        }
        button.crm-th-filtertoggle:hover { color: #111827; text-decoration: underline; }
        .crm-th-sort-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .crm-th-sort-buttons { display: inline-flex; align-items: center; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
        th:hover .crm-th-sort-buttons { opacity: 1; }
        .crm-th-sort-btn {
            border: none;
            background: transparent;
            color: #9ca3af;
            font-size: 11px;
            line-height: 1;
            padding: 0 2px;
            cursor: pointer;
        }
        .crm-th-sort-btn:hover { color: #111827; }
        .crm-th-sort-btn.active { color: #111827; font-weight: 700; }
        .crm-th-filter-input {
            width: 100%;
            box-sizing: border-box;
            font: inherit;
            font-size: 13px;
            padding: 5px 8px;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            background: #fff;
        }
        select.crm-th-filter-input { cursor: pointer; }

        .crm-user-row:hover { background: #f9fafb; }
        .crm-user-name-cell {
            vertical-align: middle;
        }
        .crm-user-symbol-cell {
            width: 56px;
            text-align: center;
            vertical-align: middle;
            font-size: 12px;
            line-height: 1.35;
            color: #9ca3af;
        }
        .crm-user-symbol-dot {
            display: inline-block;
            font-size: 9px;
            line-height: 1;
            vertical-align: middle;
        }
        button.crm-user-symbol-btn {
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 12px;
            color: #9ca3af;
            padding: 1px 3px;
            margin: 0;
            vertical-align: middle;
            border-radius: 4px;
            line-height: 1;
        }
        button.crm-user-symbol-btn:hover {
            color: #5d82d1;
            background: #f3f4f6;
        }

        /* SevDesk-Style Kunden-Modal */
        #crm-customer-modal .crm-org-modal-content {
            width: min(640px, 94vw) !important;
            max-width: min(640px, 94vw);
            max-height: min(90vh, 820px);
            display: flex;
            flex-direction: column;
            margin: 2vh auto;
        }
        #crm-customer-modal .crm-org-modal-body {
            overflow-y: auto;
            padding: 6px 14px 12px;
            flex: 1;
            min-height: 0;
        }
        #crm-customer-modal .crm-org-modal-header-inner {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 14px 6px;
            border-bottom: 1px solid var(--border);
        }
        #crm-customer-modal .crm-org-modal-header-inner h2 {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            color: #111827;
        }
        #crm-customer-modal .crm-org-top-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px 18px;
            align-items: start;
        }
        #crm-customer-modal .crm-org-field label {
            display: block;
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 4px;
            font-weight: 500;
        }
        #crm-customer-modal .crm-org-field label .req { color: #2563eb; }
        #crm-customer-modal .crm-org-field input,
        #crm-customer-modal .crm-org-field select {
            width: 100%;
            box-sizing: border-box;
            padding: 6px 8px;
            border: 1px solid #d1d5db;
            border-radius: 5px;
            font-size: 13px;
            font-family: inherit;
            background: #fff;
        }
        #crm-customer-modal .crm-org-field input:focus,
        #crm-customer-modal .crm-org-field select:focus {
            outline: none;
            border-color: #93c5fd;
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
        }
        #crm-customer-modal .crm-org-row-split {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 12px;
        }
        #crm-customer-modal .crm-org-kundennum-wrap {
            display: flex;
            align-items: stretch;
            gap: 6px;
        }
        #crm-customer-modal .crm-org-kundennum-wrap input { flex: 1; min-width: 0; }
        #crm-customer-modal .crm-org-inline-icons {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 0 6px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            background: #fafafa;
            flex-shrink: 0;
        }
        #crm-customer-modal .crm-org-toggle-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 6px;
        }
        #crm-customer-modal .crm-org-switch {
            position: relative;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
        }
        #crm-customer-modal .crm-org-switch input {
            opacity: 0;
            width: 0;
            height: 0;
            position: absolute;
        }
        #crm-customer-modal .crm-org-switch-sl {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: #d1d5db;
            border-radius: 999px;
            transition: background 0.2s;
        }
        #crm-customer-modal .crm-org-switch-sl:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background: #fff;
            border-radius: 50%;
            transition: transform 0.2s;
            box-shadow: 0 1px 2px rgba(0,0,0,0.15);
        }
        #crm-customer-modal .crm-org-switch input:checked + .crm-org-switch-sl { background: #4a90e2; }
        #crm-customer-modal .crm-org-switch input:checked + .crm-org-switch-sl:before { transform: translateX(20px); }
        #crm-customer-modal .crm-org-tabs {
            display: flex;
            gap: 4px;
            border-bottom: 1px solid #e5e7eb;
            margin-top: 12px;
            padding: 0;
        }
        #crm-customer-modal .crm-org-tab {
            padding: 7px 12px;
            cursor: pointer;
            border: none;
            background: none;
            font-size: 13px;
            color: #9ca3af;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            font-family: inherit;
        }
        #crm-customer-modal .crm-org-tab:hover { color: #6b7280; }
        #crm-customer-modal .crm-org-tab.active {
            color: #111827;
            font-weight: 700;
            border-bottom-color: #ea580c;
        }
        #crm-customer-modal .crm-org-tab-panel { display: none; padding-top: 10px; }
        #crm-customer-modal .crm-org-tab-panel.active { display: block; }
        #crm-customer-modal .crm-org-section-title {
            font-size: 13px;
            font-weight: 600;
            color: #374151;
            margin: 16px 0 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid #f3f4f6;
        }
        #crm-customer-modal .crm-org-section-title:first-child { margin-top: 0; }
        #crm-customer-modal .crm-org-dyn-row {
            display: grid;
            gap: 10px;
            align-items: start;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid #f3f4f6;
        }
        #crm-customer-modal .crm-org-dyn-row:last-child { border-bottom: none; }
        #crm-customer-modal .crm-org-addr-grid {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px;
            align-items: start;
        }
        #crm-customer-modal .crm-org-addr-plz-ort {
            display: grid;
            grid-template-columns: 120px 1fr;
            gap: 10px;
        }
        #crm-customer-modal .crm-org-addr-land-kat {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        #crm-customer-modal .crm-org-contact-grid {
            display: grid;
            grid-template-columns: minmax(0,1fr) 88px 112px 36px;
            gap: 8px;
            align-items: center;
        }
        #crm-customer-modal .crm-org-contact-grid.crm-org-web-grid,
        #crm-customer-modal .crm-org-contact-grid.crm-org-email-grid {
            grid-template-columns: minmax(0,1fr) 112px 36px;
        }
        #crm-customer-modal .crm-org-btn-icon {
            border: none;
            background: none;
            color: #2563eb;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            line-height: 1;
        }
        #crm-customer-modal .crm-org-btn-icon:hover { background: #eff6ff; }
        #crm-customer-modal .crm-org-link-add {
            display: inline-block;
            margin-top: 8px;
            color: #2563eb;
            font-size: 14px;
            cursor: pointer;
            border: none;
            background: none;
            padding: 0;
            font-family: inherit;
        }
        #crm-customer-modal .crm-org-link-add:hover { text-decoration: underline; }
        #crm-customer-modal .crm-org-pay-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }
        #crm-customer-modal .crm-org-pay-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 12px;
        }
        #crm-customer-modal .crm-org-pay-toggle .crm-org-switch-on { }
        #crm-customer-modal .crm-org-info-hint {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1px solid #d1d5db;
            font-size: 11px;
            color: #6b7280;
            cursor: default;
        }
        #crm-customer-modal .modal-footer {
            border-top: 1px solid var(--border);
            padding: 14px 20px;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-shrink: 0;
        }
        #crm-customer-modal .modal-footer .btn-primary {
            background: #4a90e2;
            border-color: #4a90e2;
            color: #fff;
        }
        body.crm-inline-editor #crm-customer-modal {
            display: block !important;
            position: static;
            width: 100%;
            height: auto;
            background: transparent;
            z-index: auto;
        }
        body.crm-inline-editor #crm-customer-modal .crm-org-modal-content {
            margin: 0;
            width: 100% !important;
            max-width: none !important;
            max-height: none !important;
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: none;
        }
        body.crm-inline-editor #crm-customer-inline-editor-host { width: 100%; }
        body.crm-inline-editor #crm-customer-modal .crm-org-modal-header-inner span[onclick="app.closeCrmCustomerModal()"] {
            display: none;
        }
        .time-clock-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
        .time-clock-btns { display: flex; align-items: center; gap: 14px; }
        .time-clock-go { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
        .time-clock-go.in { background: #1b5e20; }
        .time-clock-go.in:hover:not(:disabled) { background: #2e7d32; }
        .time-clock-go.out { background: #c62828; }
        .time-clock-go.out:hover:not(:disabled) { background: #b71c1c; }
        .time-clock-go:disabled { opacity: 0.35; cursor: not-allowed; }
        .time-detect-label { font-size: 12px; color: #666; max-width: 220px; }
        .jibble-clock-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: #f3f4f6; border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; margin-bottom: 20px; }
        .jibble-timer { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; min-width: 120px; }
        .jibble-timer.jibble-timer-amber { color: #c9a227; }
        .jibble-timer.jibble-timer-muted { color: #9ca3af; }
        .jibble-clock-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .jibble-circle-btn { width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
        .jibble-circle-btn:disabled { opacity: 0.35; cursor: not-allowed; }
        .jibble-btn-green { background: #2e7d32; }
        .jibble-btn-green:hover:not(:disabled) { background: #1b5e20; }
        .jibble-btn-amber { background: #d4a017; }
        .jibble-btn-amber:hover:not(:disabled) { background: #b8860b; }
        .jibble-btn-red { background: #b71c1c; }
        .jibble-btn-red:hover:not(:disabled) { background: #8d1414; }
        .jibble-fortsetzen { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; border: 1px solid #d1d5db; background: #e5e7eb; color: #374151; font-weight: 600; cursor: pointer; font-size: 14px; }
        .jibble-fortsetzen:hover { background: #d1d5db; }
        .jibble-sublabel { font-size: 12px; color: #6b7280; margin-top: 4px; }
        .time-filter-card h3, .time-filter-card h4 { text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; color: #374151; margin: 0 0 12px 0; }
        .time-summary-row { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 8px; }
        .time-summary-legend { min-width: 200px; font-size: 13px; }
        .time-summary-legend .ln { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
        .time-summary-legend .dot { width: 10px; height: 10px; border-radius: 50%; }
        .time-dot-green { background: #43a047; }
        .time-dot-amber { background: #e6b422; }
        .time-dot-red { background: #c62828; }
        .time-chart-wrap { position: relative; flex: 1; min-width: 280px; min-height: 220px; }
        .time-donut-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
        .time-donut-center .big { font-size: 22px; font-weight: 800; }
        .time-donut-center .sub { font-size: 12px; color: #6b7280; }
        .time-split-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
        .time-split-head a { color: #6b7280; font-size: 13px; text-decoration: none; cursor: pointer; }
        .time-split-head a:hover { text-decoration: underline; }
        .jibble-co-user { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
        .jibble-co-av { width: 44px; height: 44px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #4b5563; }
        .jibble-co-meta { font-size: 12px; color: #6b7280; line-height: 1.45; }
        .btn-jibble-ghost { background: none; border: none; color: #e67e22; font-weight: 600; cursor: pointer; font-size: 15px; padding: 8px 12px; }
        .btn-jibble-primary { background: #e67e22; color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-weight: 600; cursor: pointer; }
        .btn-jibble-primary:hover { filter: brightness(1.05); }
        .input-with-icon { position: relative; }
        .input-with-icon .ic { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #9ca3af; pointer-events: none; }
        .ref-search-hits { max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; background: #fafafa; margin-top: 8px; }
        .ref-search-hit { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #eee; }
        .ref-search-hit:hover { background: #e8f4fd; }
        .ref-search-hit small { color: #888; display: block; }
        .journal-list { display: flex; flex-direction: column; gap: 8px; }
        .journal-item { border: 1px solid #e5e8ee; border-radius: 8px; background: #fbfcfe; padding: 10px 12px; }
        .customer-article-content-wrap {
            margin-top: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
            overflow: hidden;
            max-height: 0;
            opacity: 0;
            transition: max-height 280ms ease, opacity 220ms ease, padding 220ms ease;
            padding: 0 10px;
        }
        .customer-article-content-wrap.expanded {
            max-height: 1200px;
            opacity: 1;
            padding: 10px;
        }
        .customer-article-toggle-hint { font-size: 12px; color: #7a8796; margin-top: 6px; }
        .journal-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: #607083; margin-bottom: 6px; }
        .journal-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
        .journal-badge.note { background: #eef4ff; color: #245ea8; border-color: #c8dcff; }
        .journal-badge.status { background: #fff6e5; color: #996300; border-color: #ffe2a8; }
        .journal-badge.create { background: #e9f8ec; color: #1f6f3c; border-color: #bfe8cb; }
        .journal-badge.close { background: #f1f3f5; color: #4a5663; border-color: #d7dde4; }
        .change-chip { font-size: 12px; padding: 3px 6px; margin-bottom: 4px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .change-chip.planned { background: #eef4ff; border-color: #c9dbff; color: #245ea8; }
        .change-chip.in_progress { background: #fff6e5; border-color: #ffe2a8; color: #996300; }
        .change-chip.done { background: #e9f8ec; border-color: #bfe8cb; color: #1f6f3c; }
        .change-chip.cancelled { background: #f1f3f5; border-color: #d7dde4; color: #4a5663; }
        .changes-cal-day { min-height: 64px; border: 1px solid #e4e8ee; border-radius: 8px; background: #fff; padding: 5px 6px; box-sizing: border-box; transition: background 0.15s ease, border-color 0.15s ease; }
        .changes-cal-day .day-num { font-weight: 600; font-size: 12px; margin-bottom: 3px; color: #344054; }
        .changes-cal-day.has-change { background: #f3f7ff; border-color: #b9cdf2; box-shadow: inset 3px 0 0 #5d82d1; }
        .changes-cal-day.empty { background: #fafbfc; border-color: #f0f0f0; }
        .changes-cal-day-week { min-height: 110px; border: 1px solid #e4e8ee; border-radius: 8px; background: #fff; padding: 5px 6px; box-sizing: border-box; transition: background 0.15s ease, border-color 0.15s ease; }
        .changes-cal-day-week.has-change { background: #f3f7ff; border-color: #b9cdf2; box-shadow: inset 3px 0 0 #5d82d1; }
        .changes-cal-day-week .day-num { font-weight: 600; font-size: 12px; margin-bottom: 1px; color: #344054; }
        .changes-cal-day-week .day-date { font-size: 11px; color: #6b7585; margin-bottom: 5px; }
        .changes-upcoming-list { display: flex; flex-direction: column; gap: 6px; }
        .changes-upcoming-row { display: grid; grid-template-columns: 110px 1fr 140px 90px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #e4e8ee; border-radius: 8px; background: #fff; cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease; }
        .changes-upcoming-row:hover { background: #f5f8fd; border-color: #b9cdf2; }
        .changes-upcoming-row .cu-when { font-weight: 600; color: #245ea8; font-size: 13px; }
        .changes-upcoming-row .cu-title { font-size: 13px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .changes-upcoming-row .cu-customer { font-size: 12px; color: #6b7585; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .changes-upcoming-row .cu-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; text-align: center; border: 1px solid transparent; }
        .changes-upcoming-row .cu-status.planned { background: #eef4ff; border-color: #c9dbff; color: #245ea8; }
        .changes-upcoming-row .cu-status.in_progress { background: #fff6e5; border-color: #ffe2a8; color: #996300; }
        .changes-upcoming-row .cu-status.done { background: #e9f8ec; border-color: #bfe8cb; color: #1f6f3c; }
        .changes-upcoming-row .cu-status.cancelled { background: #f1f3f5; border-color: #d7dde4; color: #4a5663; }
        @media (max-width: 720px) { .changes-upcoming-row { grid-template-columns: 1fr; gap: 4px; } }
        .kb-entry-wrap { width: 100%; max-width: 100%; margin: 0 0 28px 0; }
        .kb-entry-hero {
            width: 100%; border-radius: 12px; overflow: hidden;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            border: 1px solid rgba(0,77,77,0.12);
            background: linear-gradient(180deg, #d9eef5 0%, #f0fafc 100%);
        }
        .kb-entry-hero img { width: 100%; height: 280px; display: block; vertical-align: middle; object-fit: cover; object-position: center; }
        .kb-entry-tiles { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: clamp(14px, 3vw, 28px); margin: -32px clamp(20px, 5vw, 64px) 22px clamp(20px, 5vw, 64px); position: relative; z-index: 2; }
        .kb-tile {
            background: #fff; border-radius: 14px; padding: clamp(14px, 2vw, 22px) 14px;
            box-shadow: 0 6px 20px rgba(0,0,0,0.07);
            display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
            cursor: pointer; border: 1px solid rgba(224,224,224,0.9);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .kb-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.11); }
        .kb-tile-symbol {
            width: 72px; height: 72px; border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 14px; user-select: none; color: #fff;
        }
        .kb-tile-symbol svg { width: 36px; height: 36px; flex-shrink: 0; display: block; }
        .kb-tile-label { font-size: 14px; text-align: center; color: #374151; font-weight: 600; line-height: 1.35; max-width: 100%; }
        .kb-entry-intro { font-size: 14px; line-height: 1.55; color: #4b5563; margin: 0 0 18px 0; max-width: 780px; }
        .kb-hub-search-row { width: 100%; box-sizing: border-box; margin-top: 4px; }
        .kb-hub-search-row input.search-input { width: 100%; max-width: 100%; box-sizing: border-box; padding: 12px 16px; font-size: 15px; border-radius: 10px; }
        @media (max-width: 720px) {
            .kb-entry-tiles { grid-template-columns: 1fr; }
        }
        .emp-portal-btn {
            border: 1px solid #c7d2e3;
            background: #f8fafc;
            color: #1e3a5f;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            padding: 7px 14px;
            cursor: pointer;
            white-space: nowrap;
        }
        .emp-portal-btn:hover { background: #eef2ff; border-color: #93b4e8; }
        .emp-portal-hero {
            background: linear-gradient(180deg, #e8f4f8 0%, #f7fbfc 100%);
            border: 1px solid rgba(0,77,77,0.1);
            border-radius: 12px;
            padding: 28px clamp(20px, 4vw, 40px);
            margin-bottom: 8px;
        }
        .emp-portal-hero h1 { margin: 0 0 8px 0; font-size: clamp(22px, 3vw, 28px); }
        .emp-portal-tiles { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: clamp(14px, 3vw, 28px); margin: 0 0 24px 0; }
        @media (max-width: 900px) { .emp-portal-tiles { grid-template-columns: 1fr; } }
        .emp-portal-back { color: #5d82d1; cursor: pointer; text-decoration: none; font-weight: 500; font-size: 14px; }
        .emp-portal-back:hover { text-decoration: underline; }
        .emp-hr-tabs, .emp-doc-tabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:1px solid var(--border); margin:0 0 16px 0; }
        .emp-hr-tab, .emp-doc-tab { padding:10px 16px; cursor:pointer; border:none; background:transparent; font-size:14px; color:#4b5563; border-bottom:2px solid transparent; margin-bottom:-1px; }
        .emp-hr-tab.active, .emp-doc-tab.active { color:#0f766e; border-bottom-color:#0f766e; font-weight:600; }
        .emp-hr-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px 20px; }
        .emp-hr-field label { display:block; font-size:12px; color:#6b7280; margin-bottom:4px; }
        .emp-hr-field .val { font-size:14px; font-weight:500; color:#111827; }
        .emp-hr-input {
            width:100%; box-sizing:border-box; font-size:14px; font-weight:500; color:#111827;
            border:1px solid transparent; border-radius:6px; padding:6px 8px; background:transparent;
            transition:border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
        }
        .emp-hr-field-editable:hover .emp-hr-input,
        .emp-hr-input:focus {
            border-color:#93b4e8; background:#fff; box-shadow:0 0 0 2px rgba(93,130,209,0.12); outline:none;
        }
        .emp-hr-field-readonly .emp-hr-input { cursor:default; color:#6b7280; }
        .emp-hr-field-readonly:hover .emp-hr-input { border-color:transparent; background:transparent; box-shadow:none; }
        .emp-doc-year-row td { background:#f3f4f6; font-weight:700; font-size:13px; padding:8px 10px !important; }
        .emp-info-box { background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:12px 14px; font-size:13px; color:#1e3a5f; margin-bottom:16px; }
        .kb-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: #fff; min-height: 140px; max-height: 320px; overflow: auto; }
        .kb-preview h2, .kb-preview h3, .kb-preview h4 { margin: 10px 0 8px 0; }
        .kb-preview p { margin: 6px 0; line-height: 1.4; }
        .kb-preview img { max-width: 100%; border-radius: 6px; border: 1px solid #e8e8e8; margin: 8px 0; }
        .kb-editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; background: #f8fafc; }
        .kb-editor-toolbar .btn { padding: 6px 10px; font-size: 12px; }
        .kb-editor { border: 1px solid var(--border); border-radius: 0 0 8px 8px; background: #fff; min-height: 220px; padding: 12px; overflow: auto; line-height: 1.45; }
        .kb-editor:focus { outline: none; border-color: var(--accent-color); }
        .kb-editor img { max-width: 100%; border-radius: 6px; border: 1px solid #e8e8e8; margin: 8px 0; }
        .kb-editor table { width: 100%; border-collapse: collapse; margin: 10px 0; }
        .kb-editor table th, .kb-editor table td { border: 1px solid #dfe3e8; padding: 8px; vertical-align: top; }
        .kb-editor table th { background: #f7f9fc; }
        .kb-callout { border-left: 4px solid #5a84e8; background: #eef4ff; padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
        .kb-callout.warn { border-left-color: #e39b2f; background: #fff6e8; }
        .kb-callout.danger { border-left-color: #c64a4a; background: #ffefef; }
        .kb-editor details { border: 1px solid #dfe3e8; border-radius: 6px; padding: 8px 10px; margin: 10px 0; background: #fafbfd; }
        .kb-editor details summary { cursor: pointer; font-weight: 600; }
        .tt-list-table { width:100%; background:#fff; border:1px solid var(--border); border-radius:8px; border-collapse:collapse; }
        .tt-list-table th, .tt-list-table td { padding:10px 12px; border-bottom:1px solid #eef0f3; text-align:left; vertical-align:top; }
        .tt-list-table th { background:#f8fafc; font-size:13px; color:#555; }
        .tt-row { cursor:pointer; }
        .tt-row:hover { background:#f5f8fc; }
        .tt-preview-cell { color:#666; font-size:13px; max-width:420px; }
        .tt-badge-default { font-size:11px; color:#5d82d1; font-weight:600; margin-left:6px; }
        .tt-actions-cell { text-align:right; }
        .tt-icon-btn { padding:4px 8px; min-width:auto; }
        #textTemplateModal.modal,
        #textTemplatePlaceholderModal.modal { align-items:center; justify-content:center; padding:20px; box-sizing:border-box; overflow:auto; }
        .tt-modal-content,
        .tt-ph-modal-content {
            max-width:920px; width:min(920px, calc(100vw - 40px)); margin:0;
            max-height:calc(100vh - 40px); display:flex; flex-direction:column; overflow:hidden;
        }
        .tt-ph-modal-content { max-width:720px; width:min(720px, calc(100vw - 40px)); }
        .tt-modal-content .modal-body,
        .tt-ph-modal-content .modal-body { overflow-y:auto; flex:1 1 auto; min-height:0; }
        .tt-modal-content .modal-footer,
        .tt-ph-modal-content .modal-footer { flex-shrink:0; background:#fff; }
        .tt-modal-content .modal-header,
        .tt-ph-modal-content .modal-header { flex-shrink:0; }
        .tt-content-editor { min-height:160px; max-height:240px; }
        .tt-editor-toolbar { border-radius:8px 8px 0 0; }
        .tt-ph-tabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:1px solid var(--border); margin-bottom:12px; }
        .tt-ph-tab { border:none; background:none; padding:8px 12px; cursor:pointer; font-size:13px; color:#666; border-bottom:2px solid transparent; }
        .tt-ph-tab.active { color:#c2410c; border-bottom-color:#c2410c; font-weight:600; }
        .tt-ph-panel { display:none; }
        .tt-ph-panel.active { display:block; }
        .tt-ph-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px 16px; max-height:360px; overflow:auto; }
        .tt-ph-item { display:flex; flex-direction:column; gap:2px; cursor:pointer; padding:6px 4px; border-radius:6px; }
        .tt-ph-item:hover { background:#f5f8fc; }
        .tt-ph-item input { margin:0 0 2px; }
        .tt-ph-label { font-size:13px; color:#222; }
        .tt-ph-code { font-size:12px; color:#888; }
