.kpv-customer-editor { --edit-paper:#fff;--edit-soft:#faf6f5;--edit-line:#ebdfe1;--edit-ink:#3b2630;--edit-muted:#88747b; }
.kpv-customer-editor > section { gap:24px; }
.kpv-customer-editor-header { display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px;border:1px solid var(--edit-line);border-radius:18px;background:var(--edit-paper); }
.kpv-customer-editor-heading { display:flex;align-items:center;gap:16px;min-width:0; }
.kpv-customer-editor-heading h1 { margin:0;color:#660015;font-size:24px;font-weight:700;line-height:1.5; }
.kpv-customer-editor-heading p { margin:4px 0 0;color:var(--edit-muted);font-size:13px;line-height:1.8; }
.kpv-customer-editor-back { display:grid;place-items:center;flex:none;width:42px;height:42px;border:1px solid var(--edit-line);border-radius:12px;background:var(--edit-soft);color:#660015; }
.kpv-customer-editor-back svg { width:20px;height:20px; }
.kpv-customer-editor-back:focus-visible,.kpv-customer-profile-nav a:focus-visible { outline:2px solid #bc925d;outline-offset:3px; }
.kpv-customer-editor-delete .fi-btn { min-height:40px;border:1px solid #b423182b;border-radius:10px;background:transparent!important;box-shadow:none;color:#a82c31!important; }
.kpv-customer-editor-delete .fi-btn-icon { color:inherit; }
.kpv-customer-editor-layout { display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start; }
.kpv-customer-editor-main { min-width:0; }
.kpv-customer-editor-aside { position:sticky;top:100px; }
.kpv-customer-profile { position:relative;overflow:hidden;text-align:center;padding:0 18px 16px;border:1px solid var(--edit-line);border-radius:18px;background:var(--edit-paper); }
.kpv-customer-profile-cover { height:82px;margin:0 -18px;background:radial-gradient(ellipse at 10% 0,#a54b60,transparent 65%),linear-gradient(125deg,#7b1831,#660015);position:relative; }
.kpv-customer-profile-cover:after { content:'';position:absolute;inset:15px;border:1px solid #ffc78130;border-radius:10px; }
.kpv-customer-profile-avatar { position:relative;display:block;object-fit:cover;width:104px;height:104px;margin:-45px auto 16px;border:4px solid var(--edit-paper);border-radius:24px;box-shadow:0 5px 15px #66001513; }
.kpv-customer-profile h2 { margin:0;color:var(--edit-ink);font-size:17px;font-weight:600;line-height:1.8;overflow-wrap:anywhere; }
.kpv-customer-profile-code { display:inline-block;margin-top:8px;padding:4px 9px;border:1px solid var(--edit-line);border-radius:6px;background:var(--edit-soft);font-size:11px;color:var(--edit-muted);letter-spacing:.2px; }
.kpv-customer-profile-nav { display:grid;gap:3px;margin-top:22px;padding-top:12px;border-top:1px solid var(--edit-line);text-align:left; }
.kpv-customer-profile-nav a { display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 10px;border-radius:9px;color:var(--edit-muted);font-size:13px;transition:background .2s,color .2s; }
.kpv-customer-profile-nav a:hover { color:#660015;background:var(--edit-soft); }
.kpv-customer-profile-nav svg { width:18px;height:18px;flex:none; }
.kpv-customer-profile-nav svg:last-child { width:13px;height:13px;margin-left:auto;opacity:.5; }
.kpv-customer-editor .kpv-editor-section { scroll-margin-top:100px;border:1px solid var(--edit-line);border-radius:16px;background:var(--edit-paper);box-shadow:none; }
.kpv-customer-editor .kpv-editor-section > .fi-section-header { padding:17px 22px;background:linear-gradient(110deg,#66001505,#ffc78109);border-radius:16px 16px 0 0; }
.kpv-customer-editor .kpv-editor-section .fi-section-header-heading { color:#660015;font-size:17px;font-weight:600;line-height:1.7; }
.kpv-customer-editor .kpv-editor-section .fi-section-header-icon { box-sizing:content-box;width:20px;height:20px;padding:8px;border:1px solid #ffc78155;border-radius:10px;background:#660015;color:#ffc781; }
.kpv-customer-editor .fi-section-content { padding:22px; }
.kpv-customer-editor .fi-fo-field-wrp-label { font-size:13px;color:var(--edit-ink);font-weight:500; }
.kpv-customer-editor .fi-input-wrp { min-height:46px;border:1px solid #ddcdd3;border-radius:10px;background:var(--edit-paper);box-shadow:none;--tw-ring-shadow:0 0 #0000;transition:border-color .2s,box-shadow .2s; }
.kpv-customer-editor .fi-input-wrp:focus-within { border-color:#b87b8d;box-shadow:0 0 0 3px #6600150b; }
.kpv-customer-editor .fi-input,.kpv-customer-editor .fi-select-input { min-height:44px;font-size:14px;color:var(--edit-ink); }
.kpv-customer-editor .fi-input::placeholder { color:#b19ca4;font-size:13px; }
.kpv-customer-editor .fi-input-wrp.fi-disabled { background:var(--edit-soft); }
.kpv-customer-editor .fi-fo-radio .fi-fo-radio-input { color:#660015; }
.kpv-customer-editor .fi-fo-radio label { padding:10px 16px;border:1px solid var(--edit-line);border-radius:10px;background:var(--edit-paper); }
.kpv-customer-editor .fi-fo-radio label:has(input:checked) { border-color:#66001570;background:#66001506;color:#660015; }
.kpv-customer-editor .filepond--panel-root { border:1px dashed #c9a8b2;background:var(--edit-soft);border-radius:12px; }
.kpv-customer-editor .filepond--drop-label { min-height:170px;color:var(--edit-muted);font-size:13px;line-height:1.9; }
.kpv-customer-editor .filepond--label-action { color:#660015;text-decoration-color:#b78c99; }
.kpv-customer-editor .fi-fo-rich-editor { border-radius:10px;border-color:var(--edit-line); }
.dark .kpv-customer-editor { --edit-paper:#261e25;--edit-soft:#30242c;--edit-line:#4d3440;--edit-ink:#f6e9ed;--edit-muted:#bba7af; }
.dark .kpv-customer-editor-heading h1,.dark .kpv-customer-editor .kpv-editor-section .fi-section-header-heading { color:#ffc781; }
.dark .kpv-customer-editor .fi-input-wrp { border-color:#63404e; }
.dark .kpv-customer-editor .fi-fo-radio label:has(input:checked) { border-color:#ffc78177;background:#ffc7810c;color:#ffc781; }
.dark .kpv-customer-profile-nav a:hover { color:#ffc781; }
@media(max-width:1100px) { .kpv-customer-editor-layout { grid-template-columns:220px minmax(0,1fr);gap:20px; } }
@media(max-width:900px) {
 .kpv-customer-editor-layout { grid-template-columns:1fr; }
 .kpv-customer-editor-aside { position:static; }
 .kpv-customer-profile { display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;column-gap:16px;text-align:left;padding:16px 20px; }
 .kpv-customer-profile-cover { position:absolute;inset:0 auto 0 0;width:6px;height:auto;margin:0; }
 .kpv-customer-profile-cover:after { display:none; }
 .kpv-customer-profile-avatar { grid-row:1 / 3;width:76px;height:76px;margin:0;border-radius:18px; }
 .kpv-customer-profile-code { justify-self:start;margin-top:4px; }
 .kpv-customer-profile-nav { display:none; }
}
@media(max-width:600px) {
 .kpv-customer-editor-header { align-items:flex-start;padding:18px;gap:12px; }
 .kpv-customer-editor-heading { gap:12px;align-items:flex-start; }
 .kpv-customer-editor-heading h1 { font-size:20px; }
 .kpv-customer-editor-heading p { font-size:12px; }
 .kpv-customer-editor-back { width:36px;height:36px;border-radius:10px; }
 .kpv-customer-editor-delete .fi-btn-label { display:none; }
 .kpv-customer-editor-delete .fi-btn { min-width:44px;min-height:44px;padding:10px; }
 .kpv-customer-editor .kpv-editor-section > .fi-section-header { padding:15px 16px; }
 .kpv-customer-editor .fi-section-content { padding:18px 16px; }
 .kpv-customer-editor .fi-input,.kpv-customer-editor .fi-select-input { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) { .kpv-customer-editor * { scroll-behavior:auto;transition:none!important; } }

/* Only the form becomes a wizard; the existing header and profile card stay intact. */
.kpv-customer-editor .kpv-customer-wizard {
    border:1px solid var(--edit-line);
    border-radius:16px;
    background:var(--edit-paper);
    box-shadow:none;
    --tw-ring-shadow:0 0 #0000;
}
.kpv-customer-editor .fi-fo-wizard-header {
    display:flex;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    border:0;
    border-bottom:1px solid var(--edit-line);
    border-radius:16px 16px 0 0;
    background:var(--edit-soft);
    scrollbar-width:thin;
    scroll-margin-top:92px;
}
.kpv-customer-editor .fi-fo-wizard-header-step { flex:1 0 142px;border:0; }
.kpv-customer-editor .fi-fo-wizard-header-step-button { gap:10px;width:100%;min-height:84px;padding:16px; }
.kpv-customer-editor .fi-fo-wizard-header-step-label { color:var(--edit-muted);font-size:13px;font-weight:500;line-height:1.7;white-space:nowrap; }
.kpv-customer-editor .fi-fo-wizard-header-step-icon-ctn { width:34px;height:34px;border:1px solid var(--edit-line);background:var(--edit-paper);border-radius:10px; }
.kpv-customer-editor .fi-fo-wizard-header-step-icon { width:18px;height:18px;color:var(--edit-muted); }
.kpv-customer-editor .fi-fo-wizard-header-step-separator { display:none; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-active { background:var(--edit-paper);box-shadow:inset 0 -2px #660015; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-active .fi-fo-wizard-header-step-icon-ctn { background:#660015;border-color:#660015; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-active .fi-fo-wizard-header-step-icon { color:#ffc781; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-active .fi-fo-wizard-header-step-label { color:#660015;font-weight:600; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn { background:#fff4e4;border-color:#d7b38a; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon { color:#8c582a; }
.kpv-customer-editor .fi-fo-wizard-step.fi-active { position:relative;z-index:1;min-height:500px;padding:0;animation:kpv-customer-step-in .42s both cubic-bezier(.2,.7,.2,1); }
.kpv-customer-editor .kpv-customer-wizard .kpv-editor-section { border:0;border-radius:0; }
.kpv-customer-editor .kpv-customer-wizard .fi-section-header { border-radius:0; }
.kpv-customer-editor .kpv-customer-wizard > div:last-child { padding:16px 22px;border-top:1px solid var(--edit-line); }
.kpv-customer-editor .kpv-customer-wizard > div:last-child .fi-btn { min-height:44px;border-radius:10px;padding-inline:18px; }
.kpv-customer-editor .kpv-customer-wizard > div:last-child .fi-color-primary { background:#660015!important;color:#fff!important; }
.kpv-customer-editor .kpv-customer-wizard > div:last-child .fi-color-primary .fi-btn-icon { color:#ffc781; }
.kpv-customer-editor .kpv-customer-wizard > div:last-child .fi-color-gray { background:var(--edit-paper);color:var(--edit-muted);border:1px solid var(--edit-line);box-shadow:none; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-active { box-shadow:inset 0 -2px #ffc781; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-active .fi-fo-wizard-header-step-label { color:#ffc781; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn { background:#ffc78112; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon { color:#ffc781; }
@keyframes kpv-customer-step-in { from { opacity:0;transform:translateY(10px); } to { opacity:1;transform:none; } }
@media(max-width:767px) {
    .kpv-customer-editor .fi-fo-wizard-header-step { flex-basis:134px; }
    .kpv-customer-editor .fi-fo-wizard-header-step-button { min-height:72px;padding:14px; }
    .kpv-customer-editor .fi-fo-wizard-step.fi-active { min-height:0; }
    .kpv-customer-editor .kpv-customer-wizard > div:last-child { padding:14px 16px; }
}
@media(prefers-reduced-motion:reduce) { .kpv-customer-editor .fi-fo-wizard-step.fi-active { animation:none; } }

/* Completion is a green confirmation, with one local draw-and-ring beat. */
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn {
    position:relative;
    background:#edf9f1;
    border-color:#91d4a8;
    animation:kpv-customer-step-complete .55s both cubic-bezier(.2,.8,.2,1);
}
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon { color:#16a34a; }
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon path {
    stroke-dasharray:32;
    stroke-dashoffset:0;
    animation:kpv-customer-step-check .4s .1s both ease-out;
}
.kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn::after {
    content:'';
    position:absolute;
    inset:-1px;
    border:1.5px solid #34b76b;
    border-radius:inherit;
    pointer-events:none;
    opacity:0;
    animation:kpv-customer-step-ring .7s .08s both ease-out;
}
.kpv-customer-editor .fi-fo-wizard-header-step-button:focus-visible { outline:2px solid #c69a61;outline-offset:-3px; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn { background:#143525;border-color:#348659; }
.dark .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon { color:#75dda1; }
@keyframes kpv-customer-step-complete { 0%{transform:scale(.78)}55%{transform:scale(1.14)}100%{transform:scale(1)} }
@keyframes kpv-customer-step-check { from{stroke-dashoffset:32}to{stroke-dashoffset:0} }
@keyframes kpv-customer-step-ring { 0%{opacity:.65;transform:scale(.9)}100%{opacity:0;transform:scale(1.7)} }
@media(prefers-reduced-motion:reduce) {
    .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn,
    .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon-ctn::after,
    .kpv-customer-editor .fi-fo-wizard-header-step.fi-completed .fi-fo-wizard-header-step-icon path { animation:none; }
}

/* Create uses the same editor family, with an unsaved identity preview. */
.kpv-customer-create-badge { display:flex;align-items:center;gap:8px;flex-shrink:0;padding:8px 12px;border:1px solid var(--edit-line);border-radius:9px;background:var(--edit-soft);color:var(--edit-muted);font-size:12px; }
.kpv-customer-create-badge svg { width:18px;height:18px;color:#660015; }
.kpv-customer-create-guide > div { display:flex;align-items:center;gap:10px;min-height:40px;padding:8px 10px;color:var(--edit-muted);font-size:13px; }
.kpv-customer-create-guide > div svg { width:18px;height:18px;color:#997250;opacity:1;margin:0; }
.kpv-customer-create-guide p { margin:10px 0 0;padding-top:14px;border-top:1px solid var(--edit-line);color:var(--edit-muted);font-size:11px;line-height:1.9;text-align:center; }
.dark .kpv-customer-create-badge svg { color:#ffc781; }
@media(max-width:600px) { .kpv-customer-create-badge { display:none; } }
