:root{--primary-color: #F97316;--background-color: #F8F9FA;--surface-color: #FFFFFF;--text-color: #111827;--muted-text-color: #6B7280;--border-color: #E5E7EB;--font-family: "Inter", sans-serif}*{box-sizing:border-box;margin:0;padding:0}body{font-family:var(--font-family);background-color:var(--background-color);color:var(--text-color);line-height:1.6}.app-container{padding:2rem}.form-container{width:100%;max-width:900px;margin:0 auto;background-color:var(--surface-color);border:1px solid var(--border-color);border-radius:.5rem}.control-box-header{padding:1.5rem 1.5rem 1rem}.control-box-header h1{font-size:1.75rem;font-weight:700;margin-bottom:.5rem}.control-box-header p{color:var(--muted-text-color);margin-bottom:1.5rem}.actions{display:flex;gap:1rem}.form-section{padding:1.5rem;border-top:1px solid var(--border-color)}.form-section-title{font-size:1.1rem;font-weight:600;color:var(--primary-color);margin:0 0 1.5rem}.form-subtitle{font-size:1rem;font-weight:600;margin-bottom:1rem;color:var(--text-color)}.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem}.form-group{display:flex;flex-direction:column;gap:.5rem}.form-group label{font-size:.875rem;font-weight:500;margin-bottom:0;color:var(--muted-text-color)}.form-group input,.form-group textarea,.form-group select{padding:.75rem;border:1px solid var(--border-color);border-radius:.375rem;font-family:var(--font-family);font-size:1rem;transition:border-color .2s,box-shadow .2s;background-color:#fff}.form-group select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}.form-group input:focus,.form-group textarea:focus,.form-group select:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px #f9731633}.form-group textarea{resize:vertical;min-height:80px}.logo-upload-container{margin-bottom:1rem}.logo-upload-container .btn-secondary{width:100%}.logo-preview-wrapper{display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}.editor-logo-preview{max-width:150px;max-height:70px;object-fit:contain;border:1px solid var(--border-color);border-radius:.375rem;padding:.5rem;background-color:#fdfdfd}.logo-preview-wrapper .btn-sm{width:auto}.qr-upload-container .btn-secondary{width:100%}.qr-preview-wrapper{display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}.editor-qr-preview{width:120px;height:120px;object-fit:contain;border:1px solid var(--border-color);border-radius:.375rem;padding:.5rem;background-color:var(--surface-color)}.qr-preview-wrapper .btn-sm{width:auto}.segmented-control{display:flex;border:1px solid var(--border-color);border-radius:.375rem;overflow:hidden}.segmented-control button{flex:1;padding:.75rem;border:none;background-color:transparent;color:var(--muted-text-color);font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s,color .2s}.segmented-control button:not(:last-child){border-right:1px solid var(--border-color)}.segmented-control button.active{background-color:var(--primary-color);color:#fff;font-weight:600}.segmented-control button:hover:not(.active){background-color:#f3f4f6}.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.5rem}.settings-card{border:1px solid var(--border-color);border-radius:.5rem;padding:1.25rem;background-color:#fdfdfd;display:flex;flex-direction:column;gap:1rem}.settings-card .form-subtitle{margin-bottom:.25rem}.settings-card .form-group{gap:.5rem}.form-group-toggle{flex-direction:row;align-items:center;justify-content:space-between;margin-bottom:0;padding:.5rem;border:1px solid var(--border-color);border-radius:.375rem;background-color:var(--surface-color)}.form-group-toggle label{margin-bottom:0;color:var(--text-color);font-weight:500}.toggle-switch{position:relative;display:inline-block;width:50px;height:28px;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-color:var(--border-color);border-radius:34px;cursor:pointer;transition:background-color .2s;flex-shrink:0;border:none}.toggle-switch:before{content:"";position:absolute;height:20px;width:20px;left:4px;bottom:4px;background-color:#fff;border-radius:50%;transition:transform .2s}.toggle-switch:checked{background-color:var(--primary-color)}.toggle-switch:checked:before{transform:translate(22px)}.line-items-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.line-items-header .btn{padding:.5rem 1rem;font-size:.875rem}.line-items-header .btn svg{width:16px;height:16px;margin-right:.5rem}.line-item-group{border:1px solid var(--border-color);border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;background-color:#fdfdfd}.group-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;gap:.5rem}.group-title-input{flex-grow:1;font-size:1rem;font-weight:600;border:none;background:transparent;padding:.25rem;border-radius:.25rem;transition:box-shadow .2s,background-color .2s}.group-title-input:focus{outline:none;box-shadow:0 0 0 2px #f9731633;background-color:#fff}.line-item{display:grid;grid-template-columns:3fr 1.2fr 1.2fr 1fr auto;gap:.5rem;align-items:center;margin-bottom:.5rem}.line-item-titles{display:grid;grid-template-columns:3fr 1.2fr 1.2fr 1fr auto;gap:.5rem;padding:0 .5rem;margin-bottom:.5rem;font-size:.75rem;color:var(--muted-text-color);font-weight:500}.line-item-titles span:last-of-type{padding-right:38px}.line-item input{font-size:.9rem;padding:.5rem}.line-item .line-item-amount{font-size:.9rem;text-align:right;padding-right:.5rem;color:var(--muted-text-color)}.add-item-container{margin-top:.5rem}.btn{padding:.75rem 1.5rem;border:none;border-radius:.375rem;font-size:1rem;font-weight:600;cursor:pointer;transition:background-color .2s;display:inline-flex;align-items:center;justify-content:center}.btn-sm{padding:.4rem .8rem;font-size:.875rem}.btn-sm svg{width:16px;height:16px;margin-right:.5rem}.btn-primary{background-color:var(--primary-color);color:#fff}.btn-primary:hover{background-color:#ea580c}.btn-secondary{background-color:#f3f4f6;color:#374151;border:1px solid var(--border-color)}.btn-secondary:hover{background-color:#e5e7eb}.icon-button{background:transparent;border:none;color:var(--muted-text-color);padding:.25rem;border-radius:50%;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:color .2s,background-color .2s}.icon-button svg{width:20px;height:20px}.icon-button.danger:hover{color:#ef4444;background-color:#fee2e2}.preview-controls{padding:1rem 1.5rem;background-color:var(--surface-color);border:1px solid var(--border-color);border-radius:.5rem;margin-bottom:2rem;display:flex;justify-content:space-between;align-items:center;position:sticky;top:1rem;z-index:10;box-shadow:0 4px 12px #0000000d}.preview-title{font-size:1.25rem;font-weight:600}.theme-selector-container{display:flex;align-items:center;gap:.75rem}.theme-selector-label{font-size:.875rem;font-weight:500;color:var(--muted-text-color);white-space:nowrap}.preview-controls .segmented-control{margin-bottom:0}.preview-controls .segmented-control button{padding:.5rem 1rem}#invoice-preview{position:relative;width:100%;max-width:800px;background-color:var(--surface-color);padding:4rem;margin:0 auto;box-shadow:0 4px 12px #0000000d;border:1px solid var(--border-color);border-radius:.25rem;color:#333}.paid-stamp{position:absolute;z-index:10;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-30deg);font-size:6rem;font-weight:800;color:#ef4444;opacity:.15;border:.5rem solid #EF4444;padding:.5rem 2rem;border-radius:1rem;text-transform:uppercase;pointer-events:none;-webkit-user-select:none;user-select:none}.theme-modern .invoice-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:3rem;border-bottom:1px solid var(--border-color);padding-bottom:1rem}.theme-modern .invoice-header h1{font-size:2.5rem;font-weight:700}.theme-modern .invoice-logo{width:48px;height:48px}.theme-modern .invoice-logo-image{max-width:180px;max-height:48px;object-fit:contain}.theme-modern .invoice-details{display:flex;justify-content:space-between;margin-bottom:3rem}.theme-modern .invoice-details-grid{display:grid;grid-template-columns:auto 1fr;gap:.5rem 1rem}.theme-modern .detail-label{font-weight:500;color:var(--muted-text-color)}.theme-modern .address-section{display:flex;justify-content:space-between;margin-bottom:3rem}.theme-modern .address-block{width:48%}.theme-modern .address-block h3{font-size:.875rem;font-weight:600;color:var(--muted-text-color);margin-bottom:.5rem}.theme-modern .address-block p{margin:0;line-height:1.5}.theme-modern .invoice-due{margin-bottom:3rem;border-top:1px solid var(--border-color);border-bottom:1px solid var(--border-color);padding:1.5rem 0}.theme-modern .invoice-due p{margin:0;font-size:.875rem;color:var(--muted-text-color)}.theme-modern .invoice-due .amount{font-size:2.25rem;font-weight:700;color:var(--text-color);margin-bottom:.25rem}.theme-modern .invoice-group-container{margin-bottom:2rem}.theme-modern .invoice-group-container:last-of-type{margin-bottom:0}.theme-modern .invoice-group-title{font-size:1rem;font-weight:500;margin-bottom:1rem;color:var(--text-color)}.theme-modern .invoice-table{width:100%;border-collapse:collapse;margin-bottom:2rem}.theme-modern .invoice-table th,.theme-modern .invoice-table td{padding:1rem;text-align:left}.theme-modern .invoice-table thead{border-bottom:2px solid #D1D5DB}.theme-modern .invoice-table th{font-weight:600;color:var(--muted-text-color);text-transform:uppercase;font-size:.75rem;letter-spacing:.05em;padding:.75rem 1rem}.theme-modern .invoice-table tbody tr{border-bottom:1px solid var(--border-color)}.theme-modern .invoice-table tbody tr:last-child{border-bottom:none}.theme-modern .empty-group-message{padding:2rem 1rem;text-align:center;color:var(--muted-text-color);font-style:italic}.theme-modern .text-right{text-align:right}.theme-modern .invoice-summary{display:flex;justify-content:flex-end;margin-top:3rem}.theme-modern .summary-table{width:50%;max-width:350px}.theme-modern .summary-row{display:flex;justify-content:space-between;padding:.75rem 0;border-top:1px solid var(--border-color)}.theme-modern .summary-row:first-child{border-top:none}.theme-modern .summary-row.total-row{border-top:2px solid #D1D5DB;font-weight:700;font-size:1.25rem;padding-top:1rem}.theme-modern .conversion-block{padding-top:.75rem;margin-top:.75rem;border-top:1px dashed var(--border-color)}.theme-modern .summary-row.exchange-rate-row{font-size:.8rem;font-weight:500;color:var(--muted-text-color);padding-top:0;padding-bottom:.25rem;border-top:none}.theme-modern .summary-row.converted-total-row{font-size:1rem;font-weight:500;color:var(--muted-text-color);padding-top:0;margin-top:0;border-top:none}.theme-modern .invoice-footer{margin-top:3rem;padding-top:2rem;border-top:1px solid var(--border-color);display:flex;justify-content:space-between;gap:2rem;align-items:flex-start}.theme-modern .payment-instructions{flex:3}.theme-modern .qr-code-container{flex:1;text-align:center;min-width:120px}.theme-modern .invoice-footer h4{font-size:.875rem;font-weight:600;color:var(--muted-text-color);margin-bottom:.75rem}.theme-modern .payment-instructions p{font-size:.875rem;color:var(--muted-text-color)}.theme-modern .qr-code-container img{width:120px;height:120px}#invoice-preview.theme-classic{padding:3rem;display:flex;flex-direction:column}.theme-classic .invoice-header{display:flex;justify-content:space-between;align-items:center;background-color:var(--primary-color);color:#fff;padding:2rem 3rem;margin:-3rem -3rem 2rem;border-bottom:5px solid #EA580C}.theme-classic .invoice-header h1{color:#fff;font-size:2.25rem}.theme-classic .invoice-logo{width:48px;height:48px}.theme-classic .invoice-logo-image{max-height:48px;max-width:150px;object-fit:contain}.theme-classic .invoice-logo rect{fill:#fff}.theme-classic .invoice-logo text{fill:var(--primary-color)}.theme-classic .address-section{order:1;display:flex;justify-content:space-between;margin-bottom:2rem}.theme-classic .address-block{width:48%}.theme-classic .address-block h3{font-size:.8rem;text-transform:uppercase;color:var(--muted-text-color);margin-bottom:.5rem}.theme-classic .address-block p{margin:0;line-height:1.5}.theme-classic .invoice-details{order:2;align-self:flex-end;margin-bottom:2rem;width:50%;max-width:350px}.theme-classic .invoice-details-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem 1rem;padding:1rem;background-color:#f8f9fa;border:1px solid var(--border-color);border-radius:.25rem}.theme-classic .detail-label{font-weight:600}.theme-classic .invoice-group-container{order:3;margin-bottom:0}.theme-classic .invoice-table{order:4}.theme-classic .invoice-summary{order:5}.theme-classic .invoice-footer{order:6}.theme-classic .invoice-group-title{font-size:1.1rem;font-weight:600;margin-bottom:1rem;padding-left:1rem}.theme-classic .invoice-table{width:100%;border-collapse:collapse}.theme-classic .invoice-table th,.theme-classic .invoice-table td{border:1px solid var(--border-color);padding:.75rem 1rem;text-align:left}.theme-classic .invoice-table thead{background-color:#f3f4f6}.theme-classic .invoice-table th{font-weight:600;color:var(--text-color);text-transform:none;font-size:.875rem;letter-spacing:normal}.theme-classic .invoice-table .empty-group-message{padding:2rem 1rem;text-align:center;color:var(--muted-text-color)}.theme-classic .text-right{text-align:right}.theme-classic .invoice-summary{display:flex;justify-content:flex-end;margin-top:0}.theme-classic .summary-table{width:50%;max-width:350px;border:1px solid var(--border-color);border-top:none}.theme-classic .summary-row{display:flex;justify-content:space-between;padding:.75rem 1rem;border-top:1px solid var(--border-color)}.theme-classic .summary-row.total-row{font-weight:700;font-size:1.1rem;background-color:var(--primary-color);color:#fff;border-top:1px solid var(--primary-color)}.theme-classic .conversion-block{border-top:1px solid var(--border-color)}.theme-classic .summary-row.exchange-rate-row,.theme-classic .summary-row.converted-total-row{font-size:.8rem;font-weight:500;color:var(--muted-text-color);background-color:#f8f9fa;padding:.5rem 1rem;border-top:none}.theme-classic .summary-row.converted-total-row{font-weight:600;color:var(--text-color);border-top:1px solid var(--border-color)}.theme-classic .invoice-footer{margin-top:2rem;padding-top:2rem;border-top:1px solid var(--border-color);display:flex;justify-content:space-between;gap:2rem}.theme-classic .payment-instructions{flex:3}.theme-classic .qr-code-container{flex:1;text-align:center}.theme-classic .invoice-footer h4{font-size:.875rem;font-weight:600;color:var(--muted-text-color);margin-bottom:.75rem}@media (max-width: 1200px){.app-container{padding:1rem}#invoice-preview{padding:2rem}.theme-classic .invoice-header{padding:1.5rem 2rem;margin:-2rem -2rem 1.5rem}}@media (max-width: 768px){.preview-controls{flex-direction:column;gap:1rem}}@media print{@page{size:A4;margin:.75in}body{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;background-color:#fff!important}.form-container,.actions,.btn,.preview-controls{display:none!important}.app-container,.preview-mode-container,.preview-container,#invoice-preview{display:block!important;width:100%!important;height:auto!important;overflow:visible!important;padding:0!important;margin:0!important;box-shadow:none!important;border:none!important;position:static!important}#invoice-preview *{color:#000!important;background-color:transparent!important;box-shadow:none!important;text-shadow:none!important}.theme-modern .invoice-logo rect,.theme-classic .invoice-logo text{fill:#f97316!important}.theme-classic .invoice-logo rect{fill:#fff!important}.invoice-logo-image{display:block!important}#invoice-preview{font-size:10pt}h1,h2,h3,h4,h5,h6{page-break-after:avoid}#invoice-preview h1{font-size:24pt}#invoice-preview.theme-modern .invoice-due .amount{font-size:20pt}#invoice-preview.theme-modern .summary-row.total-row{font-size:12pt}#invoice-preview th{font-size:8pt}.invoice-header,.invoice-details,.address-section,.invoice-due,.invoice-group-container,.invoice-summary,.invoice-footer{margin-bottom:2rem}.invoice-table{width:100%;border-collapse:collapse;margin-bottom:0}.invoice-table thead{display:table-header-group}.invoice-table th,.invoice-table td{padding:.5rem}.invoice-table tbody tr{page-break-inside:avoid}.invoice-header,.invoice-due,.summary-row.total-row,.invoice-footer{border-color:#ccc!important}.invoice-table thead{border-bottom:2px solid #aaa!important}.invoice-table tbody tr{border-bottom:1px solid #eee!important}a[href]:after{content:""!important}.address-block,.invoice-group-container,.invoice-footer{page-break-inside:avoid}.empty-group-message{border:1px dashed #ccc;padding:1rem}.invoice-footer{flex-direction:row!important}.paid-stamp{display:block!important;color:#ef4444!important;border-color:#ef4444!important;opacity:.15!important}.theme-classic .invoice-header{background-color:#f97316!important;border-bottom:5px solid #EA580C!important}.theme-classic .invoice-header h1,.theme-classic .summary-row.total-row{color:#fff!important}.theme-classic .summary-row.total-row{background-color:#f97316!important}.theme-classic .invoice-table th,.theme-classic .invoice-table td{border:1px solid #ccc!important}.theme-classic .invoice-table thead{background-color:#f2f2f2!important}}
