:root{--bg: #f4f6f8;--surface: #fff;--header-bg: #2f4f3e;--header-text: #fff;--accent: #3d6b4f;--accent-hover: #2f543d;--border: #d8dee4;--stato-aperto: #fde8e8;--stato-chiuso: #e8f5e9;--stato-da-reg: #fff3e0;--yellow-col: #fff9c4;--row-readonly: #f3f4f6}tr.row-readonly{opacity:.72}tr.row-readonly td{background-color:var(--row-readonly)}*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,system-ui,sans-serif;background:var(--bg);color:#1a1a1a}.app-header{background:var(--header-bg);color:var(--header-text);padding:.75rem 1.5rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}.app-header h1{margin:0;font-size:1.15rem;font-weight:600}.toolbar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:1rem 1.5rem;background:var(--surface);border-bottom:1px solid var(--border)}button,.btn{cursor:pointer;border:none;border-radius:6px;padding:.45rem .9rem;font-size:.875rem;background:var(--accent);color:#fff}button:hover{background:var(--accent-hover)}button.secondary{background:#6b7280}button.secondary:hover{background:#4b5563}button.link{background:none;color:#1d4ed8;text-decoration:underline;padding:0}.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center}.login-card{background:var(--surface);padding:2rem;border-radius:10px;box-shadow:0 4px 20px #00000014;width:100%;max-width:360px}.login-card h1{margin-top:0;font-size:1.25rem}.login-card label{display:block;margin-bottom:.25rem;font-size:.85rem;font-weight:500}.login-card input{width:100%;padding:.5rem .65rem;margin-bottom:1rem;border:1px solid var(--border);border-radius:6px}.error{color:#b91c1c;font-size:.875rem;margin-bottom:.75rem}.table-wrap{overflow:auto;margin:0 1rem 1rem;max-height:calc(100vh - 180px);border:1px solid var(--border);background:var(--surface)}table{border-collapse:collapse;font-size:.8rem;min-width:100%}th,td{border:1px solid var(--border);padding:.35rem .5rem;white-space:nowrap}th{background:var(--header-bg);color:#fff;position:sticky;top:0;z-index:2}tr.stato-aperto td:nth-child(3){background:var(--stato-aperto);font-weight:600}tr.stato-chiuso td:nth-child(3){background:var(--stato-chiuso)}tr.stato-da-registrare td:nth-child(3){background:var(--stato-da-reg)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:100;padding:1rem}.modal{background:var(--surface);border-radius:10px;width:100%;max-width:900px;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.modal-header{padding:1rem 1.25rem;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}.modal-body{padding:1rem 1.25rem;overflow:auto;flex:1}.modal-body pre{background:#f8fafc;padding:1rem;border-radius:6px;font-size:.75rem;overflow:auto;max-height:300px}.invoice-view-wrap{display:flex;flex-direction:column;gap:.75rem}.invoice-view-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.fe-sheet{background:#fff;color:#111;max-width:210mm;margin:0 auto;padding:12mm 14mm;border:1px solid #d1d5db;border-radius:4px;box-shadow:0 4px 24px #00000014;font-size:10pt;line-height:1.45}.fe-sheet-header{display:flex;justify-content:space-between;gap:1rem;border-bottom:2px solid #2f4f3e;padding-bottom:.75rem;margin-bottom:1rem}.fe-doc-type{margin:0;font-size:1.35rem;font-weight:700;color:#2f4f3e}.fe-doc-ids{text-align:right;font-size:.95rem}.fe-doc-ids span{color:#6b7280;margin-right:.25rem}.fe-total-header strong{color:#2f4f3e;font-size:1.1rem}.fe-muted{color:#6b7280;font-size:.85rem;margin:.15rem 0 0}.fe-block{margin-bottom:1rem}.fe-block h4{margin:0 0 .4rem;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:#4b5563;border-bottom:1px solid #e5e7eb;padding-bottom:.2rem}.fe-block-compact p{margin:0;font-size:.85rem}.fe-parties{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}@media(max-width:720px){.fe-parties{grid-template-columns:1fr}}.fe-party{border:1px solid #e5e7eb;padding:.65rem .75rem;background:#f9fafb}.fe-party h3{margin:0 0 .35rem;font-size:.75rem;text-transform:uppercase;color:#6b7280}.fe-party-name{margin:0 0 .25rem;font-weight:700;font-size:1rem}.fe-party p{margin:.1rem 0;font-size:.85rem}.fe-table-wrap{overflow-x:auto}.fe-table{width:100%;border-collapse:collapse;font-size:.8rem}.fe-table th,.fe-table td{border:1px solid #d1d5db;padding:.35rem .45rem;vertical-align:top}.fe-table th{background:#f3f4f6;font-weight:600;text-align:left}.fe-table .fe-num{text-align:right;white-space:nowrap}.fe-table-summary{max-width:100%}.fe-sheet-footer{display:flex;justify-content:space-between;align-items:center;margin-top:1rem;padding-top:.75rem;border-top:2px solid #2f4f3e;font-size:1rem}.fe-footer-note{margin:.75rem 0 0;font-size:.7rem;color:#9ca3af;text-align:center}.invoice-preview{display:flex;flex-direction:column;gap:1rem}.invoice-section h4{margin:0 0 .5rem;font-size:.9rem;color:var(--header-bg);border-bottom:1px solid var(--border);padding-bottom:.25rem}.invoice-fields{margin:0;display:grid;gap:.35rem}.invoice-field{display:grid;grid-template-columns:minmax(140px,35%) 1fr;gap:.5rem;font-size:.85rem}.invoice-field dt{margin:0;font-weight:600;color:#4b5563}.invoice-field dd{margin:0}.invoice-raw summary{cursor:pointer;font-size:.85rem;color:#4b5563;margin-bottom:.5rem}.modal-fields-grid{display:grid;grid-template-columns:1fr 1fr;gap:.75rem 1rem;width:100%}.modal-fields-grid label{display:block;font-size:.85rem;margin-bottom:.25rem}.modal-fields-grid input{width:100%;padding:.45rem .65rem;border:1px solid var(--border);border-radius:6px}.field-hint-missing{color:#b45309;font-size:.8rem}.modal-footer{padding:1rem 1.25rem;border-top:1px solid var(--border);display:flex;gap:.5rem;flex-wrap:wrap;align-items:flex-end}.modal-footer label{display:block;font-size:.85rem;margin-bottom:.25rem}.modal-footer input{padding:.45rem .65rem;border:1px solid var(--border);border-radius:6px;min-width:280px}.hint{font-size:.8rem;color:#6b7280;margin:0 1.5rem .5rem}.modal-body .fe-sheet{max-height:65vh;overflow-y:auto}@media print{body *{visibility:hidden}#fattura-print-area,#fattura-print-area *{visibility:visible}#fattura-print-area{position:absolute;left:0;top:0;width:100%;max-width:none;margin:0;padding:10mm;border:none;box-shadow:none;max-height:none;overflow:visible}.no-print,.modal-backdrop,.modal-header,.modal-footer{display:none!important}}
