/* Anagrafica cliente: documento, residenza e domicilio */
.cliente-form-section-title{margin:4px 0 0;padding-bottom:8px;border-bottom:2px solid #e3e7ee}
.cliente-fieldset{min-width:0;margin:8px 0;padding:16px;border:1px solid #cfd7e3;border-radius:14px;background:#fbfcfe}
.cliente-fieldset legend{padding:0 9px;font-weight:900;font-size:18px;color:#172033}
.cliente-fieldset-grid{margin-top:8px}
.documento-autofill-box{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 14px;align-items:center;margin-bottom:12px;padding:12px;border:1px solid #8fc3c5;border-left:5px solid #155e63;border-radius:12px;background:#fff8ef}
.documento-autofill-box p{margin:0}
.documento-scan-status{grid-column:1/-1;min-height:20px;margin:0!important;font-weight:800}
.documento-scan-status.success{color:#087443}
.documento-scan-status.warning{color:#8a4b00}
.documento-autofilled{outline:3px solid rgba(16,185,129,.28)!important;background:#effdf6!important}
.domicilio-copy{display:flex!important;align-items:center;gap:9px;margin:0 0 8px;font-weight:850}
.domicilio-copy input{width:auto!important}
.domicilio-copied{background:#f1f5f9!important;color:#475569}
.address-group-start{border-left:4px solid #155e63!important;padding-left:10px!important}

/* Elenco clienti: pulsante più alto ma più stretto */
.clienti-operativa .actions-cell-scheda-only{min-width:116px!important;width:116px!important;white-space:normal!important;text-align:center}
.clienti-operativa .actions-cell-scheda-only .btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:104px!important;min-height:50px!important;padding:12px 9px!important;line-height:1.12!important;white-space:normal!important}

/* Finestra scansione barcode documento */
.documento-scan-overlay{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.78)}
.documento-scan-dialog{width:min(720px,100%);max-height:94vh;overflow:auto;border-radius:18px;background:#fff;color:#111;padding:16px;box-shadow:0 24px 70px rgba(0,0,0,.42)}
.documento-scan-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:19px}
.documento-scan-close{border:0;border-radius:10px;background:#292929;color:#fff;padding:10px 14px;font-weight:850;cursor:pointer}
.documento-camera{position:relative;overflow:hidden;aspect-ratio:4/3;border-radius:14px;background:#111}
.documento-camera video{display:block;width:100%;height:100%;object-fit:cover;transform:none!important}
.documento-camera-frame{position:absolute;left:7%;right:7%;top:29%;height:42%;border:4px solid #2f7a7e;border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.18);pointer-events:none}
.documento-camera-status{margin:10px 0;padding:10px;border-radius:10px;background:#f3f4f6;font-weight:750}
.documento-camera-status.error{background:#fee2e2;color:#991b1b}
.documento-scan-actions{display:flex;justify-content:flex-end;margin-top:9px}
.documento-manual-label{display:block;margin-top:10px;font-weight:800}
.documento-manual-label textarea{width:100%;margin-top:6px}
.documento-manual-use{margin-top:8px}

@media(max-width:700px){
  .documento-autofill-box{grid-template-columns:1fr}
  .documento-autofill-box .btn{width:100%}
  .documento-scan-overlay{padding:8px;align-items:flex-start}
  .documento-scan-dialog{max-height:98vh;border-radius:14px;padding:12px}
  .documento-camera{aspect-ratio:3/4}
  .cliente-fieldset{padding:12px}
}

/* Lettura completa documento: barcode + OCR */
.documento-autofill-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.documento-autofill-actions .btn{min-height:46px}
.documento-scan-status.processing{color:#1d4ed8}
.documento-camera-help{margin:8px 0;padding:10px 12px;border-radius:10px;background:#fff7df;color:#5f3b00;font-weight:750;line-height:1.35}
.documento-camera-status.warning{background:#fff7df;color:#8a4b00}
.documento-camera-status.success{background:#eafaf1;color:#08653b}
.documento-camera-status.processing{background:#eaf2ff;color:#164b93}
.documento-camera-ocr:disabled,.js-cliente-documento-ocr:disabled{opacity:.62;cursor:wait}
@media(max-width:700px){
  .documento-autofill-actions{display:grid;grid-template-columns:1fr}
  .documento-autofill-actions .btn{width:100%}
  .documento-scan-actions{display:grid;grid-template-columns:1fr;gap:8px}
  .documento-scan-actions .btn{width:100%}
}

/* Nuovo cliente separato e acquisizione documento guidata */
.nuovo-cliente-page{align-items:start}
.nuovo-cliente-page>.panel{margin:0}
.documento-guidato{border:2px solid #155e63;background:#f2f9f9}
.documento-step-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:16px 0}
.documento-step-card{position:relative;display:flex;flex-direction:column;gap:10px;min-width:0;padding:16px;border:1px solid #d6dce5;border-radius:14px;background:#fff}
.documento-step-card h3,.documento-step-card p{margin:0}
.documento-step-card input[type=file]{width:100%;padding:10px;border:1px dashed #9aa6b5;border-radius:10px;background:#f8fafc}
.documento-step-card .btn{margin-top:auto;min-height:48px}
.step-number{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#1f2937;color:#fff;font-weight:900}
.documento-preview{display:block;width:100%;max-height:220px;object-fit:contain;border:1px solid #cbd5e1;border-radius:10px;background:#111}
.documento-review{margin-top:12px;padding:14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff}
.documento-review h3{margin:0 0 10px}
.documento-review-groups{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.documento-review ul{margin:8px 0 0;padding-left:20px}
.documento-review li{margin:5px 0}
.documento-review li.ok{color:#087443}
.documento-review li.missing{color:#8a4b00}
.documento-privacy-note{margin-bottom:0}
.nuovo-cliente-actions{position:sticky;bottom:0;z-index:20;padding:12px;border-top:1px solid #d6dce5;background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}
.clienti-operativa-leggera th,.clienti-operativa-leggera td{vertical-align:middle}
.clienti-table-wrap-leggera{max-height:none}
.scheda-cliente-compact{min-width:110px!important;min-height:50px!important;padding:12px 10px!important}
.panel-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dashboard-light .action-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}

@media(max-width:900px){
  .documento-step-grid{grid-template-columns:1fr}
  .documento-review-groups{grid-template-columns:1fr}
  .nuovo-cliente-actions{margin-left:-8px;margin-right:-8px}
}

.documento-mrz-card{border:2px solid var(--accent,#2855c5);}
.documento-mrz-preview{max-height:260px;object-fit:contain;background:#111;}
.documento-retro-completo{margin-top:14px;text-align:left;}
.documento-retro-completo summary{cursor:pointer;font-weight:700;margin-bottom:10px;}

/* Fotocamera guidata e privacy documenti */
.documento-step-grid-guidato{grid-template-columns:repeat(2,minmax(0,1fr))}
.documento-save-choice{display:flex!important;align-items:flex-start;gap:12px;margin:12px 0 4px;padding:14px;border:2px solid #0f766e;border-radius:12px;background:#ecfdf5;font-weight:700}
.documento-save-choice input{width:auto!important;margin-top:3px}
.documento-save-choice span{display:grid;gap:4px}
.documento-save-choice small{font-weight:500;color:#475569;line-height:1.35}
.documento-guide-overlay{position:fixed;inset:0;z-index:120000;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(0,0,0,.88)}
.documento-guide-dialog{width:min(760px,100%);max-height:98vh;overflow:auto;padding:14px;border-radius:18px;background:#fff;color:#111;box-shadow:0 20px 70px rgba(0,0,0,.55)}
.documento-guide-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;font-size:19px}
.documento-guide-close{border:0;border-radius:10px;background:#222;color:#fff;padding:10px 13px;font-weight:800}
.documento-guide-camera{position:relative;overflow:hidden;aspect-ratio:4/3;border-radius:14px;background:#111}
.documento-guide-camera video{width:100%;height:100%;object-fit:cover;display:block;transform:none!important}
.documento-guide-mask{position:absolute;inset:0;pointer-events:none}
.documento-guide-box{position:absolute;border:4px solid #2f7a7e;border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.42)}
.documento-guide-address .documento-guide-box{left:5%;right:5%;top:8%;height:58%}
.documento-guide-mrz .documento-guide-box{left:6%;right:6%;top:63%;height:27%;border-radius:8px}
.documento-guide-full .documento-guide-box{left:4%;right:4%;top:8%;height:84%}
.documento-guide-help,.documento-guide-status{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:#fff7df;font-weight:750;line-height:1.35}
.documento-guide-status{background:#eef2ff;color:#1e3a8a}
.documento-guide-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:10px}
.documento-guide-actions .btn{min-height:48px}
@media(max-width:900px){.documento-step-grid-guidato{grid-template-columns:1fr}}
@media(max-width:700px){
 .documento-guide-overlay{padding:6px;align-items:flex-start}
 .documento-guide-dialog{padding:10px;border-radius:12px}
 .documento-guide-camera{aspect-ratio:3/4}
 .documento-guide-actions{display:grid;grid-template-columns:1fr}
 .documento-guide-actions .btn{width:100%}
 .documento-guide-address .documento-guide-box{left:5%;right:5%;top:14%;height:54%}
 .documento-guide-mrz .documento-guide-box{left:5%;right:5%;top:66%;height:22%}
}

/* Modalità semplice: una sola foto del retro, lettura automatica e controllo */
.documento-easy-flow{border:3px solid #155e63;background:#f7fbfb;padding:18px}
.documento-easy-flow [hidden]{display:none!important}
.documento-easy-heading{display:flex;align-items:flex-start;gap:14px}
.documento-easy-heading h2,.documento-easy-heading p{margin:0}
.documento-easy-heading p{margin-top:5px;font-size:17px;line-height:1.4}
.documento-easy-number{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;background:#111827;color:#fff;font-size:24px;font-weight:950}
.documento-easy-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:18px 0}
.documento-easy-progress-step{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:9px;border:2px solid #d7dde7;border-radius:12px;background:#fff;color:#64748b}
.documento-easy-progress-step span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e2e8f0;color:#475569;font-weight:900}
.documento-easy-progress-step.active{border-color:#155e63;background:#edf7f7;color:#0f4f53}
.documento-easy-progress-step.active span{background:#155e63;color:#111}
.documento-easy-progress-step.done{border-color:#16a34a;background:#effdf4;color:#166534}
.documento-easy-progress-step.done span{background:#16a34a;color:#fff}
.documento-easy-progress-step.done span::after{content:'✓';font-size:18px}
.documento-easy-progress-step.done span{font-size:0}
.documento-easy-main{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(240px,.9fr);gap:16px;align-items:stretch}
.documento-easy-instruction{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-height:260px;padding:20px;border:2px solid #d6dce5;border-radius:16px;background:#fff}
.documento-easy-instruction h3{margin:6px 0;font-size:25px}
.documento-easy-instruction p{margin:0 0 16px;font-size:17px;line-height:1.45}
.documento-easy-icon{font-size:50px;line-height:1}
.documento-easy-start{width:100%;min-height:64px;font-size:20px;font-weight:950;letter-spacing:.02em}
.documento-easy-retry{width:100%;min-height:52px;margin-top:9px;font-weight:850}
.documento-easy-preview-wrap{display:flex;flex-direction:column;justify-content:center;min-width:0;padding:10px;border:2px solid #d6dce5;border-radius:16px;background:#111}
.documento-easy-preview{display:block;width:100%;max-height:330px;object-fit:contain;border-radius:10px;background:#111}
.documento-easy-preview-caption{margin:8px 0 0;color:#fff;text-align:center;font-size:14px}
.documento-easy-working{display:flex;align-items:center;gap:14px;margin:15px 0 8px;padding:15px;border:2px solid #2563eb;border-radius:14px;background:#eff6ff;color:#1e3a8a}
.documento-easy-working b{font-size:18px}.documento-easy-working p{margin:3px 0 0}
.documento-easy-spinner{flex:0 0 34px;width:34px;height:34px;border:5px solid #bfdbfe;border-top-color:#2563eb;border-radius:50%;animation:documentoEasySpin .8s linear infinite}
@keyframes documentoEasySpin{to{transform:rotate(360deg)}}
.documento-easy-flow .documento-scan-status{margin:14px 0 0!important;padding:13px 15px;border-radius:12px;background:#f1f5f9;font-size:17px;line-height:1.4}
.documento-easy-flow .documento-scan-status.success{background:#ecfdf3;border:2px solid #16a34a;color:#166534}
.documento-easy-flow .documento-scan-status.warning{background:#eef8f8;border:2px solid #155e63;color:#0f4f53}
.documento-easy-flow .documento-scan-status.processing{background:#eff6ff;border:2px solid #2563eb;color:#1e3a8a}
.documento-easy-flow:not(.easy-has-result) .documento-review{display:none}
.documento-easy-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.documento-easy-actions .btn{min-height:54px;padding:12px 16px;font-weight:900}
.documento-easy-actions [data-easy-continue]{flex:1 1 100%;font-size:18px}
.documento-save-choice-compact{margin-top:16px;background:#f8fafc;border-color:#94a3b8}
.documento-easy-alternative{margin-top:14px;padding:12px 14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff}
.documento-easy-alternative summary{cursor:pointer;font-weight:850;color:#334155}

/* Fotocamera semplice: sagoma unica che corrisponde esattamente al ritaglio */
.documento-easy-camera-overlay{position:fixed;inset:0;z-index:140000;display:flex;align-items:center;justify-content:center;padding:10px;background:rgba(0,0,0,.92)}
.documento-easy-camera-dialog{width:min(820px,100%);max-height:98vh;overflow:auto;padding:14px;border-radius:18px;background:#fff;color:#111;box-shadow:0 24px 80px rgba(0,0,0,.6)}
.documento-easy-camera-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:20px}
.documento-easy-camera-close{border:0;border-radius:10px;background:#1f2937;color:#fff;padding:11px 14px;font-weight:850}
.documento-easy-camera-order{margin:10px 0;padding:10px 12px;border-radius:10px;background:#fff7df;font-size:17px;text-align:center}
.documento-easy-camera-view{position:relative;overflow:hidden;aspect-ratio:3/4;border-radius:14px;background:#111}
.documento-easy-camera-view video{display:block;width:100%;height:100%;object-fit:cover;transform:none!important}
.documento-easy-card-box{position:absolute;left:4%;right:4%;top:50%;aspect-ratio:1.586/1;transform:translateY(-50%);border:5px solid #2f7a7e;border-radius:16px;box-shadow:0 0 0 999px rgba(0,0,0,.48);pointer-events:none}
.documento-easy-card-box::before{content:'RETRO DELLA CARTA';position:absolute;left:50%;top:-38px;transform:translateX(-50%);padding:6px 10px;border-radius:8px;background:#2f7a7e;color:#111;font-weight:950;white-space:nowrap}
.documento-easy-zone{position:absolute;left:2%;right:2%;display:flex;align-items:center;justify-content:center;border:2px dashed rgba(255,255,255,.95);border-radius:8px;color:#fff;text-shadow:0 1px 3px #000;font-size:13px;font-weight:950;letter-spacing:.04em}
.documento-easy-zone-address{top:3%;height:43%;background:rgba(37,99,235,.12)}
.documento-easy-zone-mrz{bottom:2%;height:38%;background:rgba(22,163,74,.12)}
.documento-easy-camera-status{margin:10px 0 0;padding:11px;border-radius:10px;background:#eef2ff;color:#1e3a8a;text-align:center;font-weight:800}
.documento-easy-camera-actions{display:flex;gap:10px;margin-top:10px}
.documento-easy-camera-actions .btn{min-height:58px;font-size:18px;font-weight:950}
.documento-easy-camera-capture{flex:1}

@media(max-width:760px){
 .documento-easy-flow{padding:12px}
 .documento-easy-heading p{font-size:16px}
 .documento-easy-progress-step{display:grid;gap:4px;min-height:68px;text-align:center;font-size:13px}
 .documento-easy-main{grid-template-columns:1fr}
 .documento-easy-instruction{min-height:0;padding:16px}
 .documento-easy-instruction h3{font-size:22px}
 .documento-easy-preview{max-height:260px}
 .documento-easy-camera-overlay{align-items:flex-start;padding:4px}
 .documento-easy-camera-dialog{padding:9px;border-radius:12px}
 .documento-easy-camera-view{height:min(68vh,720px);aspect-ratio:auto}
 .documento-easy-card-box{left:3%;right:3%;border-width:4px}
 .documento-easy-camera-actions{display:grid;grid-template-columns:1fr}
 .documento-easy-camera-switch{order:2}
 .documento-easy-actions{display:grid;grid-template-columns:1fr}
 .documento-easy-actions .btn{width:100%}
}

/* Flusso semplificato: nessuna fotografia del fronte, codice fiscale dal retro. */
.documento-cf-fast-card{margin-top:16px;border:2px solid #16a34a;background:#f0fdf4;padding:18px;border-radius:14px}
.documento-cf-fast-card h3{margin:0 0 8px;font-size:22px}
.documento-cf-fast-card .btn{min-height:58px;font-size:18px;font-weight:950;width:100%}
