:root{--bg: #f7f7f9;--card: #ffffff;--border: #e2e8f0;--text: #0f172a;--muted: #475569;--accent: #2563eb}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--text)}.container{max-width:1000px;margin:24px auto;padding:0 16px}h1{font-size:28px;margin-bottom:16px}.card{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:16px;margin-bottom:16px}.card-header{font-weight:600;margin-bottom:12px}label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px}input,textarea{width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:6px;margin-bottom:10px;font-size:14px}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}.btn{background:var(--accent);border:1px solid var(--accent);color:#fff;padding:10px 14px;border-radius:6px;cursor:pointer}.btn:hover{filter:brightness(.95)}.btn-outline{background:transparent;border:1px solid var(--border);color:var(--text);padding:8px 12px;border-radius:6px;cursor:pointer}.logo-preview{margin-top:8px;height:60px;width:160px;border:1px dashed var(--border);display:grid;place-items:center}.logo-preview img{max-height:58px;max-width:158px;object-fit:contain}.table-responsive{overflow-x:auto}table.items-table{width:100%;border-collapse:collapse}table.items-table th,table.items-table td{border:1px solid var(--border);padding:6px;font-size:14px}table.items-table th{background:#f0f5ff}.items-actions{margin-top:10px}.totals-box{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}.totals-box>div{background:#f9fafb;border:1px solid var(--border);border-radius:6px;padding:10px;display:flex;justify-content:space-between;align-items:center}.totals-box .grand{background:#fff7ed;border-color:#fed7aa}.actions{display:flex;justify-content:flex-end;margin:16px 0}.error-box{background:#fee2e2;border:1px solid #fecaca;color:#7f1d1d;padding:8px 12px;border-radius:6px;margin-bottom:12px}.hidden-preview{position:fixed;left:0;top:0;opacity:0;pointer-events:none;z-index:-1;width:794px}.invoice-a4{width:794px;min-height:1123px;padding:24px;background:#fff;color:#111827;border:1px solid #e5e7eb;display:flex;flex-direction:column}.invoice-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.logo-box{width:200px;height:90px;border:1px solid #e5e7eb;display:grid;place-items:center}.logo-box img{max-width:190px;max-height:80px;object-fit:contain}.logo-placeholder{color:#9ca3af}.seller .title,.buyer .title,.invoice-bank .title,.invoice-notes .title,.invoice-terms .title{font-weight:700;margin-bottom:4px}.seller .name,.buyer .name{font-weight:600}.invoice-info{padding:8px;border:1px solid #e5e7eb}.invoice-type-center{flex:1;text-align:center;font-weight:800;text-transform:uppercase;font-size:18px}.parties{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:8px;border:1px solid #e5e7eb;margin-bottom:12px}.po-shipping-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:8px;border:1px solid #e5e7eb;margin-bottom:12px;background:#f8fafc}.invoice-table{width:100%;border-collapse:collapse;margin-bottom:12px}.invoice-table th,.invoice-table td{border:1px solid #e5e7eb;padding:6px;font-size:13px}.invoice-totals{margin-left:auto;width:320px;border:1px solid #e5e7eb}.invoice-totals>div{display:flex;justify-content:space-between;padding:8px 10px}.invoice-totals .grand{background:#fff7ed;border-top:1px solid #e5e7eb}.po-totals-table{margin-left:auto;width:360px;border:1px solid #e5e7eb}.po-totals-table .row{display:flex;justify-content:space-between;padding:8px 10px;border-top:1px solid #e5e7eb}.po-totals-table .row:first-child{border-top:none}.po-totals-table .grand{background:#fff7ed}.invoice-bank,.invoice-terms{border:1px solid #e5e7eb;padding:8px 10px;margin-bottom:8px}.text-pre{white-space:pre-line}.invoice-notes{border:1px solid #e5e7eb;padding:8px 10px}@media (max-width: 768px){.grid-2,.grid-3{grid-template-columns:1fr}}.tabs{display:flex;gap:8px;margin:12px 0 16px}.tab{padding:8px 12px;border:1px solid var(--border);border-radius:6px;background:#fff;cursor:pointer}.tab.active{background:#f0f5ff;border-color:#c7d2fe}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{width:90vw;max-width:1000px;height:85vh;background:#fff;border-radius:8px;box-shadow:0 10px 30px #0003;display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #e5e7eb;font-weight:600}.modal-actions{display:flex;gap:8px}.modal-body{flex:1;padding:0}.pdf-frame{width:100%;height:100%;border:none}.po .po-top{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:8px}.po .po-company{border:1px solid #e5e7eb;padding:8px 10px}.po .po-company-name{font-weight:700;margin-bottom:4px}.po .po-title{display:grid;grid-template-rows:auto 1fr;align-items:start}.po .po-title>div:first-child{font-weight:800;font-size:20px;text-align:right}.po .po-orderbox{margin-top:8px;border:1px solid #1e3a8a;background:#eff6ff;padding:8px 10px}.po .po-orderbox>div{display:flex;justify-content:space-between}.po .po-orderbox span{color:#1e3a8a;font-weight:600}.po .po-vc{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:12px 0}.po .po-section{border:1px solid #1e3a8a}.po .po-section-title{background:#1e3a8a;color:#fff;padding:6px 10px;font-weight:700}.po .po-fields>div{display:grid;grid-template-columns:180px 1fr;gap:8px;padding:8px 10px;border-top:1px solid #e5e7eb}.po .po-fields>div span{color:#334155}.po .po-shipping-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;border:1px solid #1e3a8a;margin-bottom:8px}.po .po-shipping-row>div{display:grid;grid-template-columns:180px 1fr;background:#1e3a8a;color:#fff;padding:6px 10px}.po .po-shipping-row span{font-weight:700}.po table.po-items{width:100%;border-collapse:collapse;margin-bottom:12px}.po table.po-items th{background:#1e3a8a;color:#fff}.po table.po-items th,.po table.po-items td{border:1px solid #e5e7eb;padding:6px;font-size:13px}.po .po-bottom{display:grid;grid-template-columns:1fr 360px;gap:16px}.po .po-note{border:1px solid #e5e7eb}.po .po-note .po-section-title{background:#1e3a8a;color:#fff}.footer-line{height:1px;margin-top:auto;background:linear-gradient(90deg,#0473ea,#0473ea 50%,#38d200 50%,#38d200)}
