.studio-grid{display:grid;grid-template-columns:minmax(360px,1.05fr) minmax(340px,1fr);gap:24px;align-items:start}.studio-controls{display:grid;gap:22px;min-width:0}.studio-step{display:block;color:var(--blue);font-size:9px;letter-spacing:1.8px;font-weight:700;margin:0 0 12px}.studio-preview{position:sticky;top:20px;min-width:0}.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.preview-heading>span{display:flex;align-items:center;gap:7px;color:#476877;letter-spacing:1.4px;font-size:9px;font-weight:700}.preview-heading i{width:6px;height:6px;border-radius:50%;background:#339779}.preview-heading>small{color:#8998a2;font-size:9px;text-align:right}.paper-preview{padding:18px;background:#e7ecf1;border:1px solid #dbe3e9;border-radius:10px;overflow:auto;max-height:calc(100dvh - 150px)}.paper-preview .invoice{margin:0 auto;box-shadow:0 4px 15px #1c374917;width:100%;padding:24px;font-size:11px}.paper-preview .invoice.paper-80mm{width:302px}.paper-preview .bill-brand{gap:10px}.paper-preview .bill-brand h1{font-size:21px}.paper-preview .bill-label{min-width:100px}.paper-preview .bill-label strong{font-size:15px}.paper-preview .bill-logo{width:48px;height:48px}.paper-preview .bill-sign span{min-width:105px}.paper-preview .bill-table th,.paper-preview .bill-table td{padding:10px 5px;font-size:9px}.paper-preview .bill-totals{max-width:270px}.studio-preview>.hint{font-size:10px;margin:12px 3px}.studio-save{display:flex;align-items:center;justify-content:space-between;gap:15px;position:sticky;bottom:89px;z-index:8;margin-top:25px;padding:16px 20px;background:#fffffff5;border:1px solid var(--border);border-radius:10px;box-shadow:0 -5px 30px #12384c0d;backdrop-filter:blur(8px)}.studio-save>span{font-size:11px;color:#6e8795}.brand-presets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:18px 0 20px}.brand-preset{padding:5px 5px 8px;border:1px solid #e0e6eb;border-radius:8px;background:white;min-width:0}.brand-preset>span{display:block;height:42px;border-radius:4px;background:linear-gradient(90deg,var(--swatch-dark) 0 28%,#f0f4f7 28% 100%);position:relative;margin-bottom:7px}.brand-preset>span:after{content:'';position:absolute;top:9px;left:35%;width:50%;height:7px;border-radius:2px;background:var(--swatch);box-shadow:0 12px 0 #d7e1e8}.brand-preset strong{font-size:9px;font-weight:600;color:#516b7c;display:block;white-space:normal;line-height:1.4}.brand-preset.selected{border-color:var(--swatch);box-shadow:0 0 0 2px color-mix(in srgb,var(--swatch) 15%,transparent)}.identity-preview{border-radius:9px;overflow:hidden;background:var(--identity-dark);margin-top:15px}.identity-preview>div{padding:22px;display:flex;align-items:center;gap:14px}.identity-preview strong{display:block;color:#fff;font-size:18px;overflow-wrap:anywhere}.identity-preview small{display:block;color:#c1d0d8;font-size:10px;margin-top:7px}.identity-monogram{padding:10px 12px;background:var(--identity-accent);border-radius:6px;color:#fff;font-size:25px}.identity-logo{width:52px;height:52px;object-fit:contain;background:#fff;border-radius:5px}.identity-banner{display:block;width:100%;height:95px;object-fit:cover}.theme-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0 24px}.theme-choice{position:relative;display:block;border:1px solid #dfe6ec;border-radius:8px;padding:9px;cursor:pointer;min-width:0;background:white}.theme-choice:has(input:checked){border-color:var(--blue);box-shadow:0 0 0 2px color-mix(in srgb,var(--blue) 15%,transparent);background:#f7faff}.theme-choice>input{position:absolute;right:6px;top:6px;accent-color:var(--blue);z-index:2}.theme-choice>strong{display:block;font-size:11px;margin:10px 0 5px}.theme-choice>small{font-size:8px;color:#8b9aa6;display:block;line-height:1.5;min-height:24px}.theme-thumb{display:block;position:relative;height:94px;border:1px solid #dfe6ec;background:white;padding:13px 9px 9px;overflow:hidden;box-shadow:0 2px 8px #203e4e07}.theme-thumb i{display:block;width:52%;height:5px;background:var(--swatch);margin-bottom:5px}.theme-thumb b{display:block;height:2px;background:#c5d0d9;width:37%;margin-bottom:13px}.theme-thumb em{display:block;height:9px;background:linear-gradient(90deg,#e6edf3 0 45%,transparent 45% 54%,#e6edf3 54% 73%,transparent 73% 80%,#e6edf3 80% 100%);border-bottom:1px solid white}.theme-thumb small{display:block;width:38%;height:9px;margin:8px 0 0 auto;background:var(--swatch)}.thumb-modern{border-top:19px solid var(--swatch);padding-top:8px}.thumb-modern i{width:40%;height:3px}.thumb-minimal{border:0}.thumb-minimal small{height:2px}.thumb-ledger em{outline:1px solid #d4dfe7;height:10px}.thumb-ledger{border-top:3px double var(--swatch)}.thumb-detailed{background:linear-gradient(#f1f4fa 0 38%,white 38%)}.thumb-urdu{direction:rtl}.thumb-urdu i,.thumb-urdu b{margin-left:0;margin-right:0}.thumb-urdu small{margin-left:auto;margin-right:0}.thumb-compact{padding-top:9px}.thumb-compact em{height:6px}.thumb-thermal{max-width:65px;margin:auto;border-style:dashed}.thumb-thermal i,.thumb-thermal b{margin-left:auto;margin-right:auto}.studio-details{border-top:1px solid #e7edf2;padding:16px 0 4px;margin-top:7px}.studio-details>summary{color:#36576c;font-size:12px;font-weight:600;cursor:pointer;margin-bottom:13px}.studio-details>p{font-size:11px}.section-order-row{display:flex;align-items:center;gap:9px;border:1px solid #e4ebf0;background:#fafcfd;border-radius:6px;padding:7px 9px;margin-bottom:6px}.section-order-row>.check{flex:1;margin:0}.section-order-row>div{display:flex;gap:4px}.section-order-row .btn{padding:5px 8px;min-height:27px}.drag-handle{font-size:20px;color:#a7b6bf;cursor:grab}.column-control{display:grid;grid-template-columns:110px 1fr;align-items:center;gap:12px}.column-control>.field{margin-bottom:10px}.extra-field-row{display:grid;grid-template-columns:1fr 1fr 30px;gap:9px;align-items:center}.extra-field-row .field{margin-bottom:12px}.extra-field-row .icon-btn{margin-top:8px}.trash-summary{display:flex;align-items:center;gap:18px;border:1px solid #dde6ec;border-radius:10px;padding:22px;background:#fff;margin-bottom:20px}.trash-summary strong{font-size:17px;color:#29495e}.trash-summary p{font-size:11px;margin:6px 0 0}.trash-icon{font-size:35px;color:#668a9e;width:55px;height:55px;background:#edf3f7;border-radius:13px;display:grid;place-items:center}.reset-card{border-color:#edd8d1;background:#fffdfb}.reset-card>.btn{margin-right:12px}.bill-editor-modal{width:1260px!important}.bill-editor-grid{display:grid;grid-template-columns:minmax(360px,1fr) minmax(350px,1fr);gap:25px;align-items:start}.editor-section{padding:20px;border:1px solid #e1e8ee;border-radius:9px;margin-bottom:20px}.editor-preview{position:sticky;top:0;min-width:0}.editor-preview .paper-preview{max-height:calc(100dvh - 240px)}.edit-bill-line{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;padding:15px;border:1px solid #e0e8ef;background:#fbfcfd;border-radius:7px;margin-bottom:12px}.edit-bill-line .field{margin-bottom:12px}.edit-bill-line>.btn{justify-self:end;grid-column:1 / -1;font-size:10px}.edit-bill-line>strong{grid-column:1 / -1;font-size:12px;margin-bottom:10px}.bill-editor-grid .theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.bill-editor-grid .theme-choice>small{display:none}.primary:hover{background:var(--blue);border-color:var(--blue);filter:brightness(.94)}

.invoice .bill-block:empty{display:none}.invoice .bill-block{clear:both}.invoice .bill-block-brand{break-inside:avoid}.invoice .bill-table{table-layout:auto}.invoice .bill-col-item{min-width:80px;overflow-wrap:anywhere}.invoice .bill-table .bill-col-quantity,.invoice .bill-table .bill-col-days,.invoice .bill-table .bill-col-rate,.invoice .bill-table .bill-col-amount{font-variant-numeric:tabular-nums}.invoice .bill-totals strong{white-space:nowrap}.invoice .bill-custom{margin:18px 0;border-top:1px solid #e0e7ed;padding-top:12px}.invoice .bill-custom>p{display:flex;justify-content:space-between;gap:20px;margin-bottom:7px}.invoice .bill-custom>p:first-child:not(:has(strong)){display:block}.invoice.font-serif{font-family:Georgia,'Times New Roman',serif}.invoice.font-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.invoice.font-urdu,.invoice.layout-urdu{font-family:'Noto Nastaliq Urdu','Noto Naskh Arabic','Urdu Typesetting','Times New Roman',serif}.invoice.font-urdu .bill-brand h1,.invoice.layout-urdu .bill-brand h1{letter-spacing:0}.invoice.align-center .bill-brand{flex-wrap:wrap;justify-content:center;text-align:center}.invoice.align-center .bill-brand .bill-shop{flex-basis:70%}.invoice.align-center .bill-label{text-align:center;min-width:100%;margin-top:5px}.invoice.align-right .bill-brand{flex-direction:row-reverse}.invoice.align-right .bill-shop{text-align:right}.invoice.align-right .bill-label{text-align:left}.invoice.density-comfortable .bill-table td{padding-top:18px;padding-bottom:18px}.invoice.density-comfortable .bill-customer{margin:28px 0}.invoice.density-compact .bill-table td,.invoice.density-compact .bill-table th{padding-top:6px;padding-bottom:6px}.invoice.density-compact .bill-customer{margin:13px 0}.invoice.density-compact .bill-sign{padding-top:25px;margin-bottom:20px}.invoice.layout-modern .bill-brand{padding:25px;background:var(--bill-accent);color:white;border:0;border-radius:5px}.invoice.layout-modern .bill-brand h1,.invoice.layout-modern .bill-label strong{color:white}.invoice.layout-modern .bill-table th{background:var(--bill-accent);color:white}.invoice.layout-modern .bill-grand{background:var(--bill-accent);color:white;padding:12px 14px;border:0;border-radius:4px}.invoice.layout-minimal{border-top:6px solid var(--bill-accent)}.invoice.layout-minimal .bill-brand{border-bottom:1px solid #d8e0e6}.invoice.layout-minimal .bill-brand h1{color:#263746;font-size:28px;font-weight:500}.invoice.layout-minimal .bill-table th{background:white;color:#687f8f;border-bottom:2px solid #bccbd6}.invoice.layout-minimal .bill-grand{border-bottom:0}.invoice.layout-ledger .bill-brand{border-bottom:4px double var(--bill-accent)}.invoice.layout-ledger .bill-table th,.invoice.layout-ledger .bill-table td{border:1px solid #c2d0db}.invoice.layout-ledger .bill-table th{background:var(--bill-accent);color:white}.invoice.layout-ledger .bill-totals{border:1px solid #cbd6de;padding:12px 16px}.invoice.layout-ledger .bill-grand{border-top:3px double var(--bill-accent);border-bottom:3px double var(--bill-accent)}.invoice.layout-urdu .bill-brand{border-bottom:4px double var(--bill-accent)}.invoice.layout-urdu .bill-table th{background:var(--bill-accent);color:white;font-size:12px;letter-spacing:0}.invoice.layout-urdu .bill-totals{margin-left:0;margin-right:auto}.invoice[dir=rtl] .bill-customer>div:last-child{text-align:left}.invoice[dir=rtl] .bill-label{text-align:left}.invoice[dir=rtl] .bill-table{text-align:right}.invoice[dir=rtl] .bill-table td:not(:first-child),.invoice[dir=rtl] .bill-table th:not(:first-child){text-align:left}.invoice.layout-thermal{max-width:302px;padding:14px;font-size:10px}.invoice.layout-thermal .bill-brand{display:block;text-align:center;border-bottom:1px dashed #718190}.invoice.layout-thermal .bill-label{text-align:center;margin-top:10px}.invoice.layout-thermal .bill-brand h1{font-size:19px}.invoice.layout-thermal .bill-logo{height:44px;width:44px}.invoice.layout-thermal .bill-customer{display:block}.invoice.layout-thermal .bill-customer>div{max-width:100%;text-align:left;margin-bottom:8px}.invoice.layout-thermal .bill-table td,.invoice.layout-thermal .bill-table th{padding:6px 3px;font-size:9px;letter-spacing:0}.invoice.layout-thermal .bill-sign span{min-width:90px;font-size:8px}.invoice.layout-thermal .bill-sign{gap:10px;padding-top:25px}.invoice.layout-thermal .bill-grand{border-style:dashed;font-size:12px}.invoice.layout-thermal p{font-size:9px}.invoice.paper-80mm.align-center .bill-brand .bill-shop{flex-basis:auto}.invoice.paper-80mm.align-right .bill-brand{display:block}

@media(max-width:1250px){.theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-grid{grid-template-columns:minmax(310px,1fr) minmax(300px,1fr)}.brand-presets{grid-template-columns:repeat(3,minmax(0,1fr))}.bill-editor-grid .theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.paper-preview{padding:10px}.paper-preview .invoice{padding:18px}.paper-preview .bill-brand{flex-wrap:wrap}.paper-preview .bill-label{min-width:0}.paper-preview .bill-sign span{min-width:80px}.paper-preview .bill-totals{max-width:240px}.paper-preview .bill-brand h1{font-size:18px}}
@media(max-width:1000px){.studio-grid,.bill-editor-grid{grid-template-columns:1fr}.studio-preview,.editor-preview{position:static}.studio-preview{grid-row:1}.paper-preview,.editor-preview .paper-preview{max-height:520px}.studio-controls .theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.brand-presets{grid-template-columns:repeat(5,minmax(0,1fr))}.editor-preview{grid-row:1}.bill-editor-grid .theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px){.studio-controls .theme-grid,.bill-editor-grid .theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-grid{gap:18px}.brand-presets{grid-template-columns:repeat(3,minmax(0,1fr))}.preview-heading{align-items:flex-start}.paper-preview{padding:8px}.paper-preview .invoice{padding:14px}.paper-preview .bill-brand h1{font-size:17px}.paper-preview .bill-label strong{font-size:13px}.paper-preview .bill-customer{gap:10px}.paper-preview .bill-customer>div{max-width:65%}.paper-preview .bill-customer p{font-size:9px}.paper-preview .bill-table td,.paper-preview .bill-table th{font-size:8px;padding:8px 3px}.paper-preview .bill-grand{font-size:13px}.paper-preview .invoice.layout-modern .bill-brand{padding:14px}.paper-preview .invoice.layout-detailed .bill-brand{margin:-14px -14px 0;padding:18px 14px}.studio-save{bottom:84px;padding:12px;gap:9px}.studio-save>span{font-size:9px;max-width:95px}.studio-save>.btn{white-space:normal;flex:1;font-size:11px}.column-control{grid-template-columns:95px 1fr}.extra-field-row{grid-template-columns:1fr 28px}.extra-field-row>.field:first-child{grid-column:1}.extra-field-row>.field:nth-child(2){grid-column:1}.extra-field-row>.btn{grid-column:2;grid-row:1 / 3}.trash-summary{padding:16px;gap:12px}.trash-summary strong{font-size:15px}.trash-icon{width:45px;height:45px;flex-shrink:0}.editor-section{padding:14px}.edit-bill-line{padding:12px;gap:0 9px}.edit-bill-line .field:first-child,.edit-bill-line .field:nth-child(2){grid-column:1 / -1}.bill-editor-modal .modal-body{padding:14px}.invoice .bill-custom>p{gap:10px}.invoice.layout-thermal .bill-customer>div{max-width:100%}.invoice.paper-80mm .bill-customer>div{max-width:100%}}
@media print{.invoice{box-shadow:none;print-color-adjust:exact;-webkit-print-color-adjust:exact}.invoice .bill-block{break-inside:auto}.invoice .bill-block-brand,.invoice .bill-block-customer,.invoice .bill-block-totals,.invoice .bill-block-signature{break-inside:avoid}.invoice .bill-table thead{display:table-header-group}.invoice .bill-table tr{break-inside:avoid}.invoice[dir=rtl]{direction:rtl}}
