/* Local Twenty UI: existing CI, HIG-informed hierarchy and interaction. */
html.twenty-ui{--crm-space:8px;--crm-radius:10px;--crm-accent:#175676;--crm-surface:var(--bs-body-bg,#fff);--crm-line:var(--bs-border-color,#e1e4e8);--crm-quiet:var(--bs-secondary-color,#616971)}
.twenty-ui body{line-height:1.5}
.twenty-ui main{min-width:0;padding-bottom:40px!important}
.twenty-ui .hk-pg-header{padding-top:24px;padding-bottom:24px;margin-bottom:0}
.twenty-ui .pg-title,.twenty-ui .taskboardapp-title h1{font-size:28px;line-height:1.2;letter-spacing:-.025em;font-weight:600}
.twenty-ui .hk-pg-header p{font-size:14px;color:var(--crm-quiet);margin-top:8px!important;max-width:76ch}
.twenty-ui .card{border-radius:var(--crm-radius);box-shadow:none;border-color:var(--crm-line)}
.twenty-ui .card-header{padding:18px 20px;gap:12px;border-color:var(--crm-line)}
.twenty-ui .card-body{padding:20px}
.twenty-ui .card-header h6,.twenty-ui .card-header .h6{font-size:16px;line-height:1.4;font-weight:600;margin:0}
.twenty-ui .btn{min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:8px;font-weight:500;line-height:1.3;padding:8px 14px}
.twenty-ui .btn-sm{min-height:36px;padding:7px 11px;font-size:13px}
.twenty-ui .btn-secondary,.twenty-ui .btn-light{background:var(--crm-surface);border:1px solid var(--crm-line);color:var(--bs-body-color,#30363c)}
.twenty-ui .btn-secondary:hover,.twenty-ui .btn-light:hover{background:var(--bs-tertiary-bg,#f0f3f5);border-color:var(--crm-accent)}
.twenty-ui .btn-primary{background:var(--crm-accent);border-color:var(--crm-accent)}
.twenty-ui .btn:disabled{opacity:.48;cursor:not-allowed}
.twenty-ui :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #4799c1;outline-offset:3px;box-shadow:none}
.twenty-ui :is(input,select,textarea).form-control,.twenty-ui .form-select{min-height:38px;border-radius:8px;font-size:14px;border-color:var(--crm-line)}
.twenty-ui .form-label{font-size:13px;font-weight:600;margin-bottom:8px}
.twenty-ui textarea.form-control{line-height:1.6}
.twenty-ui .form-check{min-height:30px;display:flex;align-items:center;gap:8px}
.twenty-ui .form-check-input{flex-shrink:0;margin-top:0}
.twenty-ui .form-check-label{line-height:1.4}
.twenty-ui .navbar .btn{min-height:36px}
.twenty-ui .hk-menu .nav-link{border-radius:8px;min-height:42px;margin:2px 12px;padding-left:12px;padding-right:12px}
.twenty-ui .hk-menu .nav-link.active{background:rgba(23,86,118,.09);font-weight:600;color:var(--crm-accent)}
.twenty-ui .hk-menu .nav-link:hover{background:var(--bs-tertiary-bg,#f0f3f5)}
.twenty-ui .table{font-size:14px;line-height:1.5;margin-bottom:0}
.twenty-ui .table th{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--crm-quiet);background:var(--bs-tertiary-bg,#f6f7f8);padding:13px 16px;white-space:nowrap}
.twenty-ui .table td{padding:14px 16px;vertical-align:middle;border-color:var(--crm-line)}
.twenty-ui .table tbody tr:hover{background:rgba(23,86,118,.035)}
.twenty-ui .table-responsive{border-radius:8px;scrollbar-gutter:stable;overscroll-behavior-x:contain}
.twenty-ui .table-responsive:focus-visible{outline:2px solid #4799c1;outline-offset:2px}
.twenty-ui [data-mail-count-help]{display:none}
.twenty-ui .taskboard-header{height:auto!important;min-height:92px;align-items:flex-start!important;flex-wrap:wrap;gap:16px;padding:20px!important}
.twenty-ui .taskboardapp-title{display:flex;align-items:center;gap:20px}
.twenty-ui .taskboard-options-wrap{gap:10px!important;align-items:center}
.twenty-ui [data-mail-view-links]{margin:0!important;gap:2px!important;border:1px solid var(--crm-line);border-radius:8px;padding:3px}
.twenty-ui [data-mail-view-links]>span{display:none}
.twenty-ui [data-mail-view-links] a{padding:6px 10px;border-radius:5px;text-decoration:none;color:var(--crm-quiet);min-height:30px}
.twenty-ui [data-mail-view-links] a[aria-current=page]{background:var(--crm-accent);color:#fff}
.twenty-ui .taskboard-body{scrollbar-width:auto;scrollbar-gutter:stable;overscroll-behavior-x:contain}
.twenty-ui .crm-section-nav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 24px;padding:0}
.twenty-ui .crm-section-nav a{padding:9px 14px;border-radius:8px;border:1px solid var(--crm-line);text-decoration:none;font-size:13px;color:var(--bs-body-color);background:var(--crm-surface)}
.twenty-ui .crm-section-nav a:hover{border-color:var(--crm-accent);color:var(--crm-accent)}
.twenty-ui .crm-due-section{scroll-margin-top:90px}
.twenty-ui .crm-due-section .advance-list-item{padding:16px 0!important;border-bottom:1px solid var(--crm-line)}
.twenty-ui .crm-due-section .advance-list-item:last-child{border-bottom:0}
.twenty-ui .crm-due-section .card-header{position:relative}
.twenty-ui .crm-expand-list{margin-top:16px;width:100%}
.twenty-ui .crm-due-section .advance-list>li[data-mehr]{display:none}
.twenty-ui .crm-due-section .advance-list>li[hidden]{display:none}
.twenty-ui .crm-due-today{order:-2;border-color:rgba(23,86,118,.35)}
.twenty-ui .crm-due-overdue{order:-1}
.twenty-ui .crm-product-section{margin-bottom:16px!important;overflow:hidden}
.twenty-ui .crm-disclosure{display:flex;justify-content:space-between;align-items:center;gap:16px;width:100%;min-height:64px;padding:16px 20px;background:var(--crm-surface);border:0;text-align:left;color:var(--bs-body-color);font:inherit}
.twenty-ui .crm-disclosure:hover{background:var(--bs-tertiary-bg,#f6f7f8)}
.twenty-ui .crm-disclosure-label{font-weight:600;font-size:15px}
.twenty-ui .crm-disclosure-state{color:var(--crm-quiet);font-size:12px;font-weight:400;display:block;margin-top:3px}
.twenty-ui .crm-disclosure-indicator{color:var(--crm-accent);font-size:13px;white-space:nowrap}
.twenty-ui .crm-product-section>[hidden]{display:none!important}
.twenty-ui .crm-product-section>.card-body{border-top:1px solid var(--crm-line)}
.twenty-ui .crm-context-note{padding:16px 20px;background:var(--bs-tertiary-bg,#f6f7f8);border:1px solid var(--crm-line);border-radius:var(--crm-radius);font-size:14px;line-height:1.6;margin:0 0 24px}
.twenty-ui .crm-context-note strong{display:block;color:var(--bs-body-color);margin-bottom:4px}
.twenty-ui .mail-preview-dialog{border-radius:12px;padding:28px;max-width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto}
.twenty-ui .mail-preview-dialog h2{font-size:22px;letter-spacing:-.02em}
.twenty-ui .mail-preview-dialog::backdrop{background:rgba(16,24,32,.38)}
.twenty-ui .mail-actions{gap:12px;margin-top:24px}
.twenty-ui .calendarapp-wrap .calendarapp-content .fc-toolbar{gap:12px;flex-wrap:wrap}
.twenty-ui .fc-button{min-height:38px!important;border-radius:7px!important}
.twenty-ui .calendarapp-event-sidebar .event-detail-body{line-height:1.6}
.twenty-ui [hidden]{display:none!important}
@media(min-width:1200px){.twenty-ui main.container{max-width:1600px;padding-left:28px;padding-right:28px}}
@media(max-width:991px){.twenty-ui .taskboard-header{padding:16px!important}.twenty-ui .taskboard-options-wrap{justify-content:flex-start!important;flex-basis:100%}.twenty-ui .hk-pg-header{padding-top:20px;padding-bottom:20px}.twenty-ui .pg-title,.twenty-ui .taskboardapp-title h1{font-size:25px}}
@media(max-width:600px){.twenty-ui main.container{padding-left:16px!important;padding-right:16px!important}.twenty-ui .card-body,.twenty-ui .card-header{padding:16px}.twenty-ui .btn,.twenty-ui .btn-sm,.twenty-ui .form-select,.twenty-ui input.form-control{min-height:44px}.twenty-ui input.form-control,.twenty-ui textarea.form-control,.twenty-ui .form-select{font-size:16px}.twenty-ui .hk-pg-header .pg-header-action-wrap{width:100%}.twenty-ui .crm-section-nav{flex-wrap:nowrap;overflow:auto;padding-bottom:4px}.twenty-ui .crm-section-nav a{white-space:nowrap;min-height:44px}.twenty-ui .crm-due-section .advance-list-item>div{flex-wrap:wrap;gap:12px}.twenty-ui .crm-due-section .advance-list-item>div>div{flex-wrap:wrap;gap:6px}.twenty-ui .crm-due-section .text-truncate{white-space:normal;overflow:visible}.twenty-ui .mail-preview-dialog{padding:20px}.twenty-ui .mail-actions .btn{flex:1}.twenty-ui .taskboardapp-title{gap:12px}.twenty-ui .table td,.twenty-ui .table th{padding:12px}.twenty-ui .crm-disclosure{padding:16px}}
@media(prefers-reduced-motion:reduce){.twenty-ui *, .twenty-ui *::before,.twenty-ui *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* A record's name stays readable; metadata is a separate line. */
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child{display:grid!important;grid-template-columns:minmax(0,1fr);gap:5px;flex:1}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>a{margin-left:0!important;white-space:normal;font-size:15px}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>span:last-child:not(:first-child){margin-left:0!important;white-space:normal;font-size:13px;line-height:1.5}
.twenty-ui .crm-due-today .card-header h6{color:var(--crm-accent)!important}
/* Semantic colour and familiar outline icons, within the existing brand. */
.twenty-ui .crm-icon-heading{display:flex;align-items:center;gap:12px}
.twenty-ui .crm-heading-icon,.twenty-ui .crm-product-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:38px;height:38px;border-radius:10px;background:rgba(23,86,118,.075);color:var(--crm-accent)}
.twenty-ui .crm-product-icon{width:36px;height:36px;border-radius:9px}
.twenty-ui .crm-product-labels{flex:1;min-width:0}
.twenty-ui .crm-active-count{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:999px;background:#eaf6ee!important;color:#22623b!important;font-weight:600;font-size:12px;text-transform:none}
.twenty-ui .crm-active-count svg{width:14px;height:14px}
.twenty-ui .crm-status-active{color:#22623b}
.twenty-ui .crm-status-active::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:currentColor;margin-right:6px;vertical-align:1px}
.twenty-ui .alert-warning{color:#775600}
.twenty-ui[data-bs-theme=dark] .crm-active-count{background:#193b2b!important;color:#9ce2b5!important}
.twenty-ui[data-bs-theme=dark] .crm-status-active{color:#9ce2b5}
.twenty-ui[data-bs-theme=dark] .crm-heading-icon,.twenty-ui[data-bs-theme=dark] .crm-product-icon{background:rgba(100,183,224,.12);color:#8bc9e8}
.twenty-ui[data-bs-theme=dark] .alert-warning{color:#f8d579}
/* Ladefehler-Karte (z. B. 429, Abnahme 30.10.2026 F4-07): Rot auf Rosa hatte 3,5:1, dunkel 3,8:1. Jetzt 6,8:1 bzw. 9,5:1;
   „Noch einmal“ übernimmt die Textfarbe, beim Zeigen/Fokus weiß auf dunklem Rot (7,7:1). */
.twenty-ui .alert.alert-danger{color:#a3191b}
.twenty-ui[data-bs-theme=dark] .alert.alert-danger{background:#3a1a1a;border-color:#6b2f2f;color:#ffb8b0}
.twenty-ui .alert.alert-danger .btn-flush-danger{color:inherit}
.twenty-ui .alert.alert-danger .btn-flush-danger:is(:hover,:focus,:active){color:#fff;background-color:#a3191b;border-color:#a3191b}
.twenty-ui .crm-status-pending{color:#775600}.twenty-ui[data-bs-theme=dark] .crm-status-pending{color:#f8d579}
.twenty-ui .crm-page-title{display:flex;align-items:center;gap:12px}
.twenty-ui .crm-page-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:11px;background:rgba(23,86,118,.075);color:var(--crm-accent);flex-shrink:0}
.twenty-ui .crm-page-icon svg{width:23px;height:23px}
.twenty-ui .crm-section-icon{display:inline-flex;color:var(--crm-accent);flex-shrink:0}
.twenty-ui .crm-section-icon svg{width:18px;height:18px}
.twenty-ui .crm-action-icon{width:16px;height:16px;flex-shrink:0}
.twenty-ui .crm-semantic-active{background:#eaf6ee!important;color:#22623b!important}
.twenty-ui[data-bs-theme=dark] .crm-semantic-active{background:#193b2b!important;color:#9ce2b5!important}
.twenty-ui[data-bs-theme=dark] .crm-page-icon{background:rgba(100,183,224,.12);color:#8bc9e8}
.twenty-ui[data-bs-theme=dark] .crm-section-icon{color:#8bc9e8}
/* Compact working headers: orientation without a second hero section. */
.twenty-ui .hk-pg-header{padding-top:16px;padding-bottom:16px;border-bottom:0}
.twenty-ui .pg-title,.twenty-ui .taskboardapp-title h1{font-size:23px;letter-spacing:-.02em}
.twenty-ui .crm-page-icon{width:28px;height:28px;border-radius:7px;background:none}
.twenty-ui .crm-page-icon svg{width:22px;height:22px}
.twenty-ui .hk-pg-header p{margin-top:5px!important;font-size:13px}
.twenty-ui[data-crm-page=kalender] .hk-pg-header{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0);white-space:nowrap;border:0!important}
.twenty-ui[data-crm-page=kalender] main{padding-top:12px!important;padding-bottom:12px!important}
/* Record details use a real two-column layout, separate from generic table styles. */
.twenty-ui .lead-detail .contact-detail-body>.nicescroll-bar{height:auto!important;overflow:visible!important}
.twenty-ui .lead-detail .d-flex.flex-xxl-nowrap{display:grid!important;grid-template-columns:280px minmax(0,1fr);gap:24px;align-items:start;padding:20px 0 32px}
.twenty-ui .lead-detail .contact-info{grid-column:1;grid-row:1;width:100%!important;min-width:0;padding:0!important;border:1px solid var(--crm-line)!important;border-radius:12px;background:var(--crm-surface);overflow:hidden}
.twenty-ui .lead-detail .contact-more-info{grid-column:2;grid-row:1;width:100%!important;min-width:0;margin:0!important;padding:0!important;border:0!important}
.twenty-ui .lead-detail .contact-more-info>div:first-child{margin-top:0!important}
.twenty-ui .lead-detail .contact-more-info>.mt-4,.twenty-ui .lead-detail .contact-more-info>.card.mt-4{margin-top:20px!important}
.twenty-ui .lead-detail .contact-info>.text-center{display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px 12px;text-align:left!important;padding:20px;margin:0!important;background:var(--bs-tertiary-bg,#f6f8fa)}
.twenty-ui .lead-detail .contact-info>.text-center>.avatar{grid-row:1/3;width:44px;height:44px;margin:0!important;font-size:17px}
.twenty-ui .lead-detail .contact-info .cp-name{white-space:normal!important;overflow:visible;font-size:17px;line-height:1.4;align-self:end}
.twenty-ui .lead-detail .contact-info>.text-center>.mt-2{margin-top:0!important;grid-column:2}
.twenty-ui .lead-detail .contact-info>.text-center>p{grid-column:1/-1;font-size:12px;line-height:1.5}
.twenty-ui .lead-detail .contact-info>.separator-full{display:none}
.twenty-ui .lead-detail .contact-info>.card{border:0;border-radius:0;margin:0;box-shadow:none;border-top:1px solid var(--crm-line)}
.twenty-ui .lead-detail .contact-info .card-header{padding:16px 20px 8px;border:0;background:none;font-size:13px}
.twenty-ui .lead-detail .contact-info .card-body{padding:8px 20px 18px}
.twenty-ui .lead-detail .contact-info .cp-info{padding:0;margin:0}
.twenty-ui .lead-detail .contact-info .cp-info>li{display:grid;grid-template-columns:82px minmax(0,1fr);gap:8px;align-items:start;margin:0;padding:7px 0;font-size:13px;line-height:1.5}
.twenty-ui .lead-detail .contact-info .cp-info>li>span:first-child{color:var(--crm-quiet);width:auto!important;font-size:12px}
.twenty-ui .lead-detail .contact-info .cp-info>li>span:last-child{min-width:0;width:auto!important;overflow-wrap:anywhere;color:var(--bs-body-color)}
.twenty-ui .lead-detail .contact-more-info .card{border:1px solid var(--crm-line);border-radius:12px}
.twenty-ui .lead-detail .contact-more-info .card-header{padding:16px 20px;background:none}
.twenty-ui .lead-detail .contact-more-info .card-body{padding:20px}
.twenty-ui .lead-detail .activity-wrap .avatar{width:32px;height:32px;background:rgba(23,86,118,.08);color:var(--crm-accent)}
.twenty-ui .lead-detail .activity-wrap .activity-text{font-size:14px;line-height:1.55}
.twenty-ui .lead-detail .activity-wrap .activity-time{font-size:12px;margin-top:5px}
.twenty-ui .lead-detail .vertriebsakte>div:first-child{margin:26px 0 14px!important}
.twenty-ui .lead-detail .vertriebsakte>div:first-child h2{font-size:18px;font-weight:600}
.twenty-ui .lead-detail .vertriebsakte-zusatz{display:flex;flex-direction:column;gap:10px}
.twenty-ui .lead-detail .accordion-item{border:1px solid var(--crm-line)!important;border-radius:10px!important;overflow:hidden}
.twenty-ui .lead-detail .accordion-button{display:flex;align-items:center;gap:12px;min-height:52px;padding:14px 18px;background:var(--crm-surface);color:var(--bs-body-color);font-size:14px;font-weight:600;box-shadow:none}
/* Pfeil der Akte-Karten (18.11.2026): im Fluss statt absolut oben rechts (Bündel: top:12px) → senkrecht mittig; eigene Farbe,
   denn das Bündel färbt ihn aufgeklappt weiß (für einen blauen Kopf) – auf hellem Grund war er unsichtbar. */
.twenty-ui .lead-detail .accordion-button::after{content:''!important;display:block;width:8px;height:8px;flex:0 0 8px;margin-left:auto;background:none!important;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);font-family:inherit!important;position:static!important;color:var(--crm-quiet)!important}
.twenty-ui .lead-detail .accordion-button:not(.collapsed)::after{transform:translateY(2px) rotate(225deg)}
.twenty-ui .lead-detail .accordion-button:not(.collapsed){border-bottom:0!important}
.twenty-ui .lead-detail .accordion-body{padding:20px;border-top:1px solid var(--crm-line)}
.twenty-ui .lead-detail .vertriebsakte .row.align-items-end{display:grid;grid-template-columns:140px minmax(0,1fr) 150px;gap:12px;margin:0}
.twenty-ui .lead-detail .vertriebsakte .row.align-items-end>div{width:auto;max-width:100%;padding:0}
.twenty-ui .lead-detail .vertriebsakte .row.align-items-end>.col-sm-auto{grid-column:1/-1;justify-self:end}
.twenty-ui .lead-detail .stufenleiste{gap:4px;overflow:auto;padding:4px;background:var(--bs-tertiary-bg,#f5f7f9);border-radius:10px}
.twenty-ui .lead-detail .stufe{min-width:104px;min-height:44px;padding:8px;gap:6px;border-radius:7px;border:0;font-size:12px}
.twenty-ui .lead-detail .stufe.jetzt{background:var(--crm-surface);box-shadow:0 1px 4px #00000015}
.twenty-ui .lead-detail .stufe-nr{width:20px;height:20px;font-size:12px}
.twenty-ui .lead-detail .abschluss-knopf{min-height:36px;border-radius:7px;padding:6px 12px}
@media(max-width:1199px){.twenty-ui .lead-detail .d-flex.flex-xxl-nowrap{grid-template-columns:250px minmax(0,1fr);gap:16px}.twenty-ui .lead-detail .vertriebsakte .row.align-items-end{grid-template-columns:1fr 1fr}.twenty-ui .lead-detail .vertriebsakte .row.align-items-end>.col-sm-5{grid-column:1/-1;grid-row:1}}
@media(max-width:800px){.twenty-ui .lead-detail .d-flex.flex-xxl-nowrap{grid-template-columns:minmax(0,1fr)}.twenty-ui .lead-detail .contact-info{grid-column:1;grid-row:2}.twenty-ui .lead-detail .contact-more-info{grid-column:1;grid-row:1}.twenty-ui .lead-detail .stufe{min-width:108px}}
/* Follow-ups: one selected group, quiet dividers, no nested card frames. */
.twenty-ui[data-crm-page=wiedervorlagen] .crm-section-nav{gap:4px;padding:4px;border-radius:10px;background:var(--bs-tertiary-bg,#f3f5f7);width:fit-content;margin:0 0 20px}
.twenty-ui[data-crm-page=wiedervorlagen] .crm-section-nav a{border:0;background:transparent;padding:8px 12px;display:flex;gap:8px;align-items:center;min-height:36px}
.twenty-ui[data-crm-page=wiedervorlagen] .crm-section-nav a[aria-current=true]{background:var(--crm-surface);box-shadow:0 1px 4px #00000014;color:var(--crm-accent);font-weight:600}
.twenty-ui .crm-nav-count{font-size:12px;padding:1px 6px;border-radius:5px;background:rgba(100,110,120,.09);color:var(--crm-quiet)}
.twenty-ui .crm-due-section{border:0!important;box-shadow:none!important;border-radius:0}
.twenty-ui .crm-due-section>.card-header{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);padding:0;border:0}
.twenty-ui .crm-due-section>.card-body{padding:0}
.twenty-ui .crm-due-section>.card-body>p:first-child{display:none}
.twenty-ui .crm-due-section .advance-list-item{border:0!important;border-bottom:1px solid var(--crm-line)!important;border-radius:0!important;margin:0!important;padding:14px 4px!important;box-shadow:none!important;background:none!important}
.twenty-ui .crm-due-section .advance-list-item:hover{background:var(--bs-tertiary-bg,#f6f7f8)!important}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child{grid-template-columns:minmax(0,1fr) auto;gap:5px 12px}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>a{grid-row:1;grid-column:1;font-size:14px}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>span:first-child{grid-row:1;grid-column:2}
.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>span:last-child:not(:first-child){grid-row:2;grid-column:1/-1;display:block!important;font-size:13px}
.twenty-ui .crm-due-section .advance-list-item>div>div:last-child{margin-left:24px!important;gap:6px}
.twenty-ui .crm-due-today .advance-list-item .text-danger{color:var(--crm-accent)!important}
.twenty-ui .crm-due-overdue .advance-list-item .text-danger{color:#a13e36!important}
@media(max-width:600px){.twenty-ui[data-crm-page=wiedervorlagen] .crm-section-nav{max-width:100%;width:100%}.twenty-ui .crm-due-section .advance-list-item>div>div:first-child{grid-template-columns:minmax(0,1fr)}.twenty-ui .crm-due-section .advance-list-item>div>div:first-child>span:first-child{grid-column:1;grid-row:3}.twenty-ui .crm-due-section .advance-list-item>div>div:last-child{margin-left:0!important}.twenty-ui .crm-due-section .advance-list-item>div{align-items:start!important}.twenty-ui .crm-due-section .advance-list-item>div>div:first-child{min-width:200px}}
/* Calendar dedicates its height to dates, with bounded month-cell density. */
.twenty-ui .calendarapp-wrap{height:calc(100dvh - 100px)!important;min-height:560px;border-radius:10px;margin:0!important}
.twenty-ui .calendarapp-wrap .calendarapp-sidebar{width:220px;flex:0 0 220px;display:flex;flex-direction:column;height:100%;border-right:1px solid var(--crm-line)}
.twenty-ui .calendarapp-wrap .calendarapp-sidebar>.nicescroll-bar{height:auto!important;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#aab3ba transparent}
.twenty-ui .calendarapp-wrap .calendarapp-content{padding-left:220px}
.twenty-ui .calendarapp-wrap.calendarapp-sidebar-toggle .calendarapp-content{padding-left:0}
.twenty-ui .calendarapp-wrap.calendarapp-sidebar-toggle .calendarapp-sidebar{margin-left:-220px}
.twenty-ui .calendarapp-sidebar .menu-content-wrap{padding:16px!important}
.twenty-ui .calendarapp-sidebar .separator{margin:16px 0}
.twenty-ui .calendarapp-sidebar .btn-rounded{border-radius:8px}
.twenty-ui .calendarapp-sidebar .upcoming-event-wrap .nav-link{padding:10px 0!important;border:0!important;border-bottom:1px solid var(--crm-line)!important;border-radius:0!important}
.twenty-ui .calendarapp-sidebar .upcoming-event-wrap .nav-item{margin:0}
.twenty-ui .calendarapp-sidebar .event-name{font-size:12px!important;margin-top:4px;line-height:1.45!important}
.twenty-ui .calendarapp-sidebar .categories-wrap .form-check{padding-top:5px;padding-bottom:5px;border-bottom:0;min-height:32px}
.twenty-ui .calendarapp-sidebar .title-sm{font-size:10px;letter-spacing:.06em;margin:12px 0 6px}
.twenty-ui .calendar-recordings{flex-shrink:0;padding:12px 16px!important;border-top:1px solid var(--crm-line);margin:0!important;font-size:12px}
.twenty-ui .calendar-recordings summary{font-size:12px;font-weight:600;cursor:pointer;min-height:24px}
.twenty-ui .calendar-recordings p{font-size:12px;margin:10px 0 6px;color:#22623b}
.twenty-ui .calendar-recordings small{font-size:11px;line-height:1.5;display:block}
.twenty-ui .calendarapp-wrap .fc .fc-scrollgrid-sync-table{height:100%!important}
.twenty-ui .calendarapp-wrap .fc .fc-daygrid-body{height:100%!important;min-height:0}
.twenty-ui .calendarapp-wrap .fc .fc-daygrid-day-events{min-height:0}
.twenty-ui .calendarapp-wrap .fc .fc-daygrid-event{font-size:12px;padding:2px 3px;line-height:1.4}
.twenty-ui .calendarapp-wrap .fc .fc-daygrid-more-link{font-size:11px;font-weight:600;color:var(--crm-accent);padding:3px 4px;border-radius:4px}
.twenty-ui .calendarapp-wrap .fc .fc-scroller{scrollbar-width:thin;scrollbar-color:#aab3ba transparent}
.twenty-ui .calendarapp-wrap .fc .fc-col-header-cell{font-size:11px;font-weight:500;padding:5px 0}
.twenty-ui .calendarapp-wrap .fc .fc-daygrid-day-number{font-size:12px;padding:8px}
@media(max-width:900px){.twenty-ui .calendarapp-wrap .calendarapp-sidebar{width:200px;flex-basis:200px}.twenty-ui .calendarapp-wrap .calendarapp-content{padding-left:200px}.twenty-ui .calendarapp-wrap.calendarapp-sidebar-toggle .calendarapp-sidebar{margin-left:-200px}}
@media(max-width:600px){.twenty-ui .calendarapp-wrap{height:calc(100dvh - 90px)!important;min-height:500px}.twenty-ui .calendarapp-wrap .calendarapp-content{padding-left:0!important}.twenty-ui .calendarapp-wrap .fc .fc-daygrid-event{font-size:10px}}
.twenty-ui .hk-sidebar-togglable::after{content:''!important;font-family:inherit!important;width:7px!important;height:7px!important;border-left:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);display:block;position:static!important;margin:0!important}
.twenty-ui .hk-sidebar-togglable{display:flex;align-items:center;justify-content:center}
.twenty-ui .calendarapp-sidebar-toggle .hk-sidebar-togglable::after{transform:rotate(225deg)}
/* Override the original contact template's higher-specificity zero insets. */
.twenty-ui .lead-detail .contact-info>.card .card-header{padding:16px 18px 6px!important}
.twenty-ui .lead-detail .contact-info>.card .card-body{padding:4px 18px 16px!important}
.twenty-ui .lead-detail .contact-info .cp-info>li{margin:0!important;padding:6px 0!important;min-height:0!important}
.twenty-ui .lead-detail .contact-info .cp-info>li>span{min-width:0!important;margin:0!important}
.twenty-ui .lead-detail .contact-info .cp-info>li.cp-info-block{grid-template-columns:minmax(0,1fr);gap:3px}
.twenty-ui .lead-detail .contact-info .cp-info>li.crm-empty-field{display:none}
.twenty-ui .lead-detail .contact-info .card[data-show-empty=true] .cp-info>li.crm-empty-field{display:grid}
.twenty-ui .crm-empty-toggle{padding:6px 0;margin-top:4px;border:0;background:none;color:var(--crm-quiet);font:inherit;font-size:12px;text-align:left;min-height:32px;cursor:pointer}
.twenty-ui .crm-empty-toggle:hover{color:var(--crm-accent);text-decoration:underline}
.twenty-ui .lead-detail .activity-wrap .avatar .initial-wrap{background:rgba(23,86,118,.08)!important;color:var(--crm-accent)!important}
/* Mobile Kopfzeile (29.10.2026): eine Zeile, selten genutzte Aktionen im ⋯-Menü. */
@media(max-width:760px){
.twenty-ui .hk-navbar .container-fluid{flex-wrap:nowrap;gap:8px;padding-left:10px;padding-right:10px}
.twenty-ui .hk-navbar .nav-end-wrap{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;gap:6px;margin-left:auto}
.twenty-ui .hk-navbar .mail-preview-tools{gap:6px;margin-right:0;flex-wrap:nowrap}
.twenty-ui .hk-navbar .mail-preview-tools [data-export],.twenty-ui .hk-navbar .mail-preview-tools [data-help]{display:none!important}
.twenty-ui .hk-navbar .mail-preview-tools .mail-more{display:inline-flex!important}
.twenty-ui .hk-navbar .mail-preview-tools .mail-search-key{display:none}
.twenty-ui .hk-navbar .btn{min-height:40px;min-width:40px;padding:0 10px;font-size:14px;justify-content:center;align-items:center}
.twenty-ui .hk-navbar .navbar-nav{gap:2px!important;flex-wrap:nowrap}
.twenty-ui .hk-navbar .navbar-nav .btn-primary span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.twenty-ui .hk-navbar .dropdown.ps-2{padding-left:2px!important}
body>aside[style*="position:fixed"]{font-size:10px!important;padding:2px 6px!important;opacity:.75;pointer-events:none;right:auto!important;left:8px;bottom:calc(4px + env(safe-area-inset-bottom))!important}
}
/* Abnahme 1 (29.10.2026): Konto-Knopf ohne schwarzen Kasten bei Fokus/Offen, Avatar im Dunkelmodus lesbar,
   Schließen-Knopf des Handy-Menüs ≥ 40 px breit, Kopfzeile ≤ 430 px passt mit „Cockpit“-Titel (Avatar war abgeschnitten). */
.twenty-ui .hk-navbar .dropdown-toggle.btn-flush-dark:is(:hover,:focus,:active,.show){background-color:var(--hk-bg-secondary,rgba(0,0,0,.06));border-color:transparent;color:var(--hk-text-primary,inherit)}
html[data-bs-theme=dark].twenty-ui .hk-navbar .avatar .initial-wrap{background:#1f3b4d!important;color:#d9eefa!important}
.twenty-ui .hk-menu .navbar-toggle{min-width:40px}
@media(max-width:430px){
.twenty-ui .hk-navbar .container-fluid{gap:4px;padding-left:6px;padding-right:6px}
.twenty-ui .hk-navbar .nav-end-wrap{gap:2px}
.twenty-ui .hk-navbar .mail-preview-tools{gap:2px}
.ck-navtitle{margin-left:2px!important;font-size:.9375rem!important}
}
@media(max-width:380px){.twenty-ui .hk-navbar .btn{padding-left:7px;padding-right:7px}}
@media(max-width:370px){.ck-navtitle{display:none}}

/* Marke „Twenty · echte Daten, lokale Testkopie“ (aus frontend.mjs): nie Inhalt oder Klicks verdecken (Abnahme 29.10.2026).
   Klein, dezent, links unten; Klicks gehen durch. */
html.twenty-ui body>aside[style*="position:fixed"]{
  left:12px!important;right:auto!important;bottom:10px!important;top:auto!important;z-index:5!important;pointer-events:none!important;
  padding:3px 8px!important;font:500 10.5px/1.3 "DM Sans",system-ui,sans-serif!important;border-radius:6px!important;
  background:rgba(33,37,41,.72)!important;border:0!important;color:#fff!important;opacity:.85;max-width:220px;white-space:nowrap}

/* ---------- Abnahme 30.10.2026, zweite Runde (Gruppe B2) ---------- */
/* F1-09/D3: Das Bündel gibt dem Akte-Kopf feste 65 px. Am Handy brechen „Bearbeiten“ bzw. „Zurück in die Pipeline“ in eine
   zweite Zeile und ragten 15 px über die Kopfkarte. Der Kopf wächst jetzt mit, Mindesthöhe bleibt (Desktop unverändert). */
.twenty-ui .lead-detail header.contact-header{height:auto;min-height:65px}
/* D6: Knöpfe im Akte-Kopf („Ausgeblendete Kundenakte“, „Bearbeiten“) mit 8 px Abstand wie in der Kundenakte. */
.twenty-ui .lead-detail header.contact-header .contact-options-wrap{gap:8px}
/* N2-28: Das aktive Brotkrumen-Element ist im Bündel display:flex, der Name ein anonymes Flex-Element – dort greift
   text-overflow nicht. Als Block kürzt der Name mit „…“; der Trenner davor bleibt mittig. */
.twenty-ui .lead-detail .contact-header .breadcrumb-item.active{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.twenty-ui .lead-detail .contact-header .breadcrumb-item.active::before{float:none;display:inline-block;vertical-align:middle}
/* F1-08: Abschnittstitel der Akte („Ordination“, „Ansprechperson“, „Kontakt und Zuständigkeit“, .text-primary) hatten dunkel
   1,93:1. Helles Blau wie in Kundenakte und Wiedervorlagen: 8,53:1 auf #212529. */
html.twenty-ui[data-bs-theme=dark] .lead-detail .text-primary{color:#8bc9e8!important}
/* VX1-N1 (31.10.2026): dieselben Abschnittstitel im Formular „Neuer Lead“ (/leads/neu, „+ Lead“-Popup) und im Bearbeiten-Formular
   waren dunkel ebenfalls 1,93:1 (#175676 auf #212529). Gleiche Farbe wie in der Akte. */
html[data-bs-theme=dark] form .title-wth-divider.text-primary{color:#8bc9e8!important}
/* F1-01: „Bearbeiten“ am Desktop stand in der 250–280 px schmalen linken Spalte (Felder abgeschnitten, Labels überlappend).
   Im Bearbeitungsmodus (Formular in der linken Karte) läuft die Karte über die volle Breite, Pipeline und Verlauf folgen darunter.
   Handy/Tablett ≤ 800 px bleibt einspaltig wie bisher (tabs/leads.css). */
@media(min-width:801px){
.twenty-ui[data-crm-page=leads] .lead-detail .d-flex.flex-xxl-nowrap>.contact-info:has(>.card>.card-body>form){grid-column:1/-1;grid-row:1}
.twenty-ui[data-crm-page=leads] .lead-detail .d-flex.flex-xxl-nowrap:has(>.contact-info>.card>.card-body>form)>.contact-more-info{grid-column:1/-1;grid-row:2}
}
/* D8: Fälligkeits-Marke „heute“/überfällig in /kunden und /leads (.text-danger.fw-semibold) war reines Rot (4,0:1 hell,
   3,9:1 dunkel). Dieselben Rottöne wie „vor n Tagen“ in /wiedervorlagen: hell #a13e36 (6,45:1), dunkel #f0948b (6,84:1). */
.twenty-ui main .contact-list-view .text-danger.fw-semibold{color:#a13e36!important}
.twenty-ui[data-bs-theme=dark] main .contact-list-view .text-danger.fw-semibold{color:#f0948b!important}
/* D11: /leads ohne Treffer – unter der Hinweiskarte keine Tabellenkarte mit verwaisten Spaltenköpfen (wie /kunden). */
.twenty-ui[data-crm-page=leads] .contact-list-view>.card.text-center~.card.d-md-block{display:none!important}
/* F7-03: Auswahlpfeil der Select-Felder im Dunkelmodus. Das Bündel setzt fest (!important) einen Pfeil in rgba(47,52,58,.3)
   ohne Dunkel-Variante, auf #212529 praktisch unsichtbar. Gleicher Pfeil in #9aa1a8 (5,9:1 auf #212529).
   Auswahlfelder mit Wappen/Fach-Symbol (crm-pickers.css) behalten ihr eigenes Bild. */
html.twenty-ui[data-bs-theme=dark] .form-select:not(.crm-region-selected,.crm-specialty-selected){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%239aa1a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")!important}
