/* ERP-WORKFLOW VERTRIEB V5 - gemeinsames Oberflaechensystem.
   Wird NACH app.css geladen; die Originalnavigation aus V4 bleibt unangetastet.
   Gilt fuer alle HTML/PHP-Ansichten im VERTRIEB, nicht fuer API, PDF oder Webhooks. */
:root{
 --ui-v5-ink:#253941;--ui-v5-muted:#62736f;--ui-v5-teal:#147d79;
 --ui-v5-teal-dark:#10615d;--ui-v5-gold:#d8a94e;--ui-v5-line:#e1e9e5;
 --ui-v5-bg:#f7f9f8;--ui-v5-surface:#fff;--ui-v5-radius:12px;
 --ui-v5-space:20px;
}
body.erp-v5-app,body.erp-v5-standalone{color:var(--ui-v5-ink);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:15px;line-height:1.55}
body.erp-v5-app{background:#fff}
body.erp-v5-app .content{min-width:0}
body.erp-v5-app .content-header{margin-bottom:22px;gap:16px}
body.erp-v5-app .content-header h1{letter-spacing:-.045em;line-height:1.2}
body.erp-v5-app .subheading,body.erp-v5-standalone .subheading{color:var(--ui-v5-muted);line-height:1.55}
body.erp-v5-app .panel,body.erp-v5-standalone .panel,
body.erp-v5-standalone .wf-test-card,body.erp-v5-standalone .wf-test-user{
 border:1px solid var(--ui-v5-line);border-radius:var(--ui-v5-radius);
 background:#fff;box-shadow:0 3px 14px rgba(25,50,42,.028);
}
body.erp-v5-app .panel-head{padding:19px 20px 15px;gap:12px}
body.erp-v5-app .padded{padding:12px 20px 22px}
body.erp-v5-app .left-stack,body.erp-v5-app .right-stack{gap:18px}
body.erp-v5-app .workspace-grid,body.erp-v5-app .detail-wrap{gap:20px}
body.erp-v5-app .form-grid,body.erp-v5-standalone .form-grid,
body.erp-v5-standalone .wf-test-form{gap:14px 18px}
body.erp-v5-app .form-field,body.erp-v5-standalone .form-field,
body.erp-v5-standalone .wf-test-form label{gap:7px;font-size:14px;font-weight:670;color:#3d544d}
body.erp-v5-app :where(input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="date"],input[type="search"],select,textarea),
body.erp-v5-standalone :where(input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="date"],input[type="search"],select,textarea){
 min-height:43px;max-width:100%;padding:10px 12px;border:1px solid #cbd9d3;
 border-radius:9px;background:#fff;color:var(--ui-v5-ink);font:inherit;font-size:14px;
}
body.erp-v5-app :where(input,select,textarea):focus-visible,
body.erp-v5-standalone :where(input,select,textarea):focus-visible,
body.erp-v5-app :where(button,a):focus-visible,
body.erp-v5-standalone :where(button,a):focus-visible{
 outline:2px solid var(--ui-v5-teal);outline-offset:3px;
}
body.erp-v5-app textarea,body.erp-v5-standalone textarea{min-height:84px;resize:vertical}
body.erp-v5-app .form-actions,body.erp-v5-standalone .form-actions,
body.erp-v5-standalone .wf-test-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px}
body.erp-v5-app :where(.smallbtn,.button,.btn),
body.erp-v5-standalone :where(.smallbtn,.button,.btn,.link.secondary,.link:not(.link-plain)){
 display:inline-flex;justify-content:center;align-items:center;gap:7px;
 min-height:41px;padding:9px 14px;border:1px solid #cddad4;
 border-radius:9px;background:#fff;color:#274c42;
 font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:14px;font-weight:720;
 text-decoration:none;line-height:1.3;cursor:pointer;
 transition:background-color .14s,border-color .14s,box-shadow .14s;
}
body.erp-v5-app :where(.smallbtn,.button,.btn):hover,
body.erp-v5-standalone :where(.smallbtn,.button,.btn):hover{background:#f0f6f3;border-color:#a1c1b6}
body.erp-v5-app .smallbtn.primary,body.erp-v5-standalone :where(.smallbtn.primary,.button,.btn.primary),
body.erp-v5-standalone .link:not(.secondary):not(.link-plain){
 background:var(--ui-v5-teal);border-color:var(--ui-v5-teal);
 color:#fff!important;
}
body.erp-v5-app .smallbtn.primary:hover,body.erp-v5-standalone :where(.smallbtn.primary,.button,.btn.primary):hover{
 background:var(--ui-v5-teal-dark);border-color:var(--ui-v5-teal-dark)
}
body.erp-v5-app .smallbtn.danger-outline{border-color:#e3a7a5;color:#a43835;background:#fff}
body.erp-v5-app .smallbtn.danger-outline:hover{background:#fff5f5;border-color:#c87977}
body.erp-v5-app .smallbtn.danger{border-color:#a73a35;background:#a73a35;color:#fff}
body.erp-v5-app .smallbtn.danger:hover{background:#842a27}
body.erp-v5-app .detail-table,body.erp-v5-standalone table{width:100%;border-collapse:collapse}
body.erp-v5-app .detail-table th,body.erp-v5-app .detail-table td,
body.erp-v5-standalone table th,body.erp-v5-standalone table td{
 padding:12px 13px;line-height:1.5;vertical-align:middle;border-bottom:1px solid #e9efeb;
}
body.erp-v5-app .detail-table th,body.erp-v5-standalone table th{
 text-align:left;color:#5b6c65;background:#f8faf9;font-size:12px;
 letter-spacing:.025em;font-weight:750;
}
body.erp-v5-app .detail-table tbody tr:hover,body.erp-v5-standalone table tbody tr:hover{background:#fbfcfb}
body.erp-v5-app .notice,body.erp-v5-standalone .notice{
 padding:14px 17px;border:1px solid var(--ui-v5-line);border-radius:10px;
 background:#f6faf8;color:#36554a;margin:0 0 18px;line-height:1.55;
}
body.erp-v5-app .notice.error,body.erp-v5-standalone .notice.error{background:#fff5f4;border-color:#eab6b2;color:#873a36}
body.erp-v5-app .notice.success,body.erp-v5-standalone .notice.success{background:#f2faf5;border-color:#b8ddc7;color:#285b40}
body.erp-v5-app .form-heading{margin-top:22px;padding-top:18px;border-color:#e4ece6}
body.erp-v5-standalone{background:#f8faf9}
body.erp-v5-standalone main{line-height:1.55}
body.erp-v5-standalone .login-panel{border-color:var(--ui-v5-line);box-shadow:0 10px 35px rgba(29,68,52,.055)}
body.erp-v5-standalone .wf-test-page{max-width:1100px}
body.erp-v5-standalone .wf-test-card,body.erp-v5-standalone .wf-test-user{padding:20px;margin:18px 0}
/* Auch die externen Unterlagenseiten nutzen dieselben Abstaende und Farben. */
body.erp-v5-standalone .header{background:#fff;border-bottom:1px solid var(--ui-v5-line)}
body.erp-v5-standalone main > .panel,body.erp-v5-standalone main > form > .panel{padding:22px;margin:18px 0}
body.erp-v5-standalone .panel :where(input,select,textarea){border-color:#cbd9d3;border-radius:9px}
body.erp-v5-standalone .panel :where(.grid,.two,.fields){gap:14px 18px}
body.erp-v5-standalone :where(.alert,.note){border-radius:10px;padding:13px 15px}
/* Kundenstatus: ein ruhiger Bereich in der vorhandenen Kundenakte. */
.erp-lifecycle{margin-top:24px;padding:22px 0 0;border-top:1px solid var(--ui-v5-line)}
.erp-lifecycle-heading{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;margin-bottom:16px}
.erp-lifecycle-heading h3{font-size:17px;color:var(--ui-v5-ink)}
.erp-lifecycle-heading p{margin-top:6px;color:var(--ui-v5-muted);font-size:14px}
.erp-lifecycle-state{font-size:12px;color:#386356;background:#f1f8f4;border:1px solid #d5e8dc;padding:6px 10px;border-radius:99px;white-space:nowrap}
.erp-lifecycle-state.is-disabled{color:#8c4a38;background:#fff7f0;border-color:#f0d0b3}
.erp-lifecycle form{display:grid;gap:9px}
.erp-lifecycle .form-field{max-width:740px}
.erp-lifecycle .form-field textarea{min-height:78px}
.erp-lifecycle .form-actions{margin-top:7px}
.erp-action-check{display:flex;align-items:flex-start;gap:9px;font-size:14px;color:#3d554d;cursor:pointer}
.erp-action-check input{flex:none;margin-top:4px;width:17px;height:17px;accent-color:var(--ui-v5-teal)}
.erp-lifecycle-note{padding:13px 15px;background:#fff9f3;border:1px solid #eddfca;border-radius:9px;margin-bottom:15px}
.erp-lifecycle-delete{margin-top:22px;border-top:1px solid var(--ui-v5-line);padding-top:16px}
.erp-lifecycle-delete summary{font-size:14px;color:#8a4038;font-weight:700;cursor:pointer;list-style-position:outside;padding:2px 0}
.erp-lifecycle-delete > div{padding:15px 0 4px;display:grid;gap:12px;max-width:750px}
.erp-lifecycle-delete p{color:#66736d;font-size:14px}
.erp-register-filters{display:flex;flex-wrap:wrap;gap:9px;padding:0 20px 18px}
.erp-register-filters a{padding:8px 13px;border:1px solid #dde8e2;border-radius:8px;font-size:13px;color:#405c50;background:#fff;font-weight:670}
.erp-register-filters a[aria-current="page"]{border-color:#b5d3c7;background:#eff7f2;color:#1d6559}
.erp-register-status.is-disabled{background:#fff5ec;color:#935637;border-color:#eacbb6}
@media(max-width:740px){
 body.erp-v5-app .content{padding:20px 15px 40px}
 body.erp-v5-app .panel-head,body.erp-v5-app .padded{padding-left:16px;padding-right:16px}
 body.erp-v5-app .form-grid,body.erp-v5-standalone .form-grid{grid-template-columns:minmax(0,1fr)}
 body.erp-v5-app .form-actions .smallbtn,body.erp-v5-standalone .form-actions .smallbtn{min-height:43px}
 .erp-lifecycle-heading{flex-direction:column;align-items:flex-start}
 .erp-register-filters{padding:0 16px 16px}
}
@media(prefers-reduced-motion:reduce){body.erp-v5-app *,body.erp-v5-standalone *{scroll-behavior:auto;transition:none!important}}

/* Kopfbereich auf schmalen Displays: Breadcrumb und Aktionen getrennt.
   Verhindert Kollisionen von Menue-Titel und Abmelden-Button. */
@media(max-width:740px){
 body.erp-v5-app .topbar{height:auto;min-height:64px;flex-wrap:wrap;align-items:center;padding:12px 15px;gap:8px}
 body.erp-v5-app .breadcrumb{flex:1 1 100%;min-width:0;max-width:100%;overflow:hidden;font-size:13px;gap:8px}
 body.erp-v5-app .breadcrumb span,body.erp-v5-app .breadcrumb strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.erp-v5-app .breadcrumb strong{flex:1;min-width:0}
 body.erp-v5-app .top-actions{width:100%;justify-content:flex-end;gap:8px}
 body.erp-v5-app .top-actions .smallbtn{min-height:36px;padding:7px 10px;font-size:12px}
}

/* V7: Ausscheiden aus dem aktiven Kundenbestand – ruhig, klar, bewusst bestaetigt. */
.erp-lifecycle-archive{margin-top:22px;border-top:1px solid var(--ui-v5-line);padding-top:16px}
.erp-lifecycle-archive summary{font-size:14px;font-weight:700;color:#8a4038;cursor:pointer}
.erp-lifecycle-archive > div{padding:15px 0 4px;display:grid;gap:12px;max-width:760px}
.erp-lifecycle-archive p{color:#66736d;font-size:14px}
.erp-lifecycle-archive select,.erp-lifecycle-archive textarea,.erp-lifecycle-archive input[type=text]{width:100%}
.erp-archive-facts{line-height:1.9;color:#415850;background:#f6f9f7;padding:15px;border-radius:9px}


/* ERP-WORKFLOW V8: 10-px-Abstandssystem fuer alle sichtbaren PHP-Seiten.
   Kein globales margin:10px auf jedes Element: Das wuerde Navigation,
   Tabellen und Formulare verschieben. Stattdessen ein gemeinsames 10-px-Raster.
   Die vorhandenen Funktionen, die Hauptnavigation und die Farben bleiben erhalten. */
:root{--ui-v5-space:10px;--ui-v8-space:10px}
/* Arbeitsflaeche und die Abstaende ZWISCHEN den Abschnitten. */
body.erp-v5-app .content{padding:10px 10px 28px}
body.erp-v5-app .content-header{gap:10px;margin:0 0 10px}
body.erp-v5-app .content-header .subheading{margin:10px 0 0}
body.erp-v5-app .content > :where(.panel,.workspace-grid,.detail-wrap,.overview,.quick-section,.notice,.erp-customer-register,.mkt-dashboard-workspace){margin-bottom:10px}
body.erp-v5-app .content > :where(.panel,.workspace-grid,.detail-wrap,.overview,.quick-section,.notice):last-child{margin-bottom:0}
body.erp-v5-app .content :where(.workspace-grid,.detail-wrap,.left-stack,.right-stack,.overview,.quick-grid,.section-cards,.form-grid,.bar-actions,.form-actions,.module-new-actions,.module-create-area,.module-extra-notes,.mkt-dashboard-workspace,.erp-artikel-grid){gap:10px}
body.erp-v5-app .content :where(.module-create-area,.module-extra-notes){margin-bottom:10px;margin-top:10px}
/* Karten und Formulare bekommen auf jeder Modulansicht dieselbe Innenkante. */
body.erp-v5-app .panel-head,body.erp-v5-app .padded{padding:10px}
body.erp-v5-app .tasks{padding:0 10px 10px}
body.erp-v5-app .task{gap:10px;padding:10px 0}
body.erp-v5-app :where(.side-card,.metric,.quick-link,.section-card){padding:10px}
body.erp-v5-app .section-bottom{padding:10px}
body.erp-v5-app .quick-section{margin-top:10px}
body.erp-v5-app .quick-head{margin-bottom:10px}
body.erp-v5-app .section-intro{margin-bottom:10px}
body.erp-v5-app .side-card .side-text{margin-bottom:10px}
body.erp-v5-app .inquiry-message{margin:10px 0;padding:10px 0}
body.erp-v5-app .explainer{margin-top:10px;padding:10px}
body.erp-v5-app .content .detail-table th,body.erp-v5-app .content .detail-table td,body.erp-v5-app .content table th,body.erp-v5-app .content table td{padding:10px}
body.erp-v5-app .form-grid{margin:10px 0}
body.erp-v5-app .form-field{gap:10px}
body.erp-v5-app .form-actions{margin-top:10px}
body.erp-v5-app .form-heading{margin-top:10px;padding-top:10px}
body.erp-v5-app .notice{padding:10px;margin:0 0 10px}
body.erp-v5-app :where(.smallbtn,.button,.btn){gap:10px;padding:10px}
body.erp-v5-app .content :where(.erp-list-top,.erp-list-foot){padding:10px;gap:10px}
body.erp-v5-app .erp-register-filters{gap:10px;padding:0 10px 10px}
body.erp-v5-app .erp-register-filters a{padding:10px}
body.erp-v5-app .erp-lifecycle{margin-top:10px;padding-top:10px}
body.erp-v5-app .erp-lifecycle-heading{gap:10px;margin-bottom:10px}
body.erp-v5-app .erp-lifecycle-heading p{margin-top:10px}
body.erp-v5-app .erp-lifecycle :where(.erp-lifecycle-delete,.erp-lifecycle-archive){margin-top:10px;padding-top:10px}
body.erp-v5-app .erp-lifecycle :where(.erp-lifecycle-note,.erp-archive-facts){padding:10px;margin-bottom:10px}
/* Eigenstaendige PHP-Seiten (Login, Setup, DEMO-/TEST-Zugaenge,
   Kundenunterlagen, Erweiterungen, GoCardless-Rueckkehr). */
body.erp-v5-standalone .wf-test-page{margin:10px auto;padding:10px}
body.erp-v5-standalone .wf-test-card,body.erp-v5-standalone .wf-test-user{padding:10px;margin:10px 0}
body.erp-v5-standalone main > .panel,body.erp-v5-standalone main > form > .panel{padding:10px;margin:10px 0}
body.erp-v5-standalone .form-grid,body.erp-v5-standalone .wf-test-form{gap:10px;margin:10px 0}
body.erp-v5-standalone .form-field,body.erp-v5-standalone .wf-test-form label{gap:10px}
body.erp-v5-standalone .form-actions,body.erp-v5-standalone .wf-test-actions{gap:10px;margin-top:10px}
body.erp-v5-standalone :where(.smallbtn,.button,.btn){gap:10px;padding:10px}
body.erp-v5-standalone :where(.alert,.note,.notice){padding:10px;margin:10px 0}
body.erp-v5-standalone .panel :where(.grid,.two,.fields){gap:10px}
body.erp-v5-standalone table th,body.erp-v5-standalone table td{padding:10px}
@media(max-width:740px){
 body.erp-v5-app .content{padding:10px 10px 28px}
 body.erp-v5-app .topbar{padding:10px;gap:10px}
 body.erp-v5-app .panel-head,body.erp-v5-app .padded{padding:10px}
 body.erp-v5-app .erp-register-filters{padding:0 10px 10px}
}
