:root{--orange:#f0522d;--ink:#171717;--muted:#6b6b66;--line:#deded9;--canvas:#ececea;--green:#2b8a5a;--red:#b42318}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--canvas);color:var(--ink);font-family:Arial,"Helvetica Neue",sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}.muted{color:var(--muted)}.eyebrow{margin:24px 0 4px;color:var(--orange);font-size:11px;font-weight:900;letter-spacing:.1em;text-transform:uppercase}.brand-logo{display:inline-flex;flex-direction:column;font-size:20px;font-weight:900;letter-spacing:-1px;line-height:.83;white-space:nowrap}.brand-logo span:last-child{display:flex;align-items:center}.brand-logo i{width:10px;height:10px;margin:1px 0 0 4px;border:3px solid var(--orange);border-radius:50%}.auth-page,.setup-page{display:grid;min-height:100vh;place-items:center;padding:24px;background:linear-gradient(135deg,#eee 0,#ddd 100%)}.auth-card,.setup-card{width:min(100%,460px);padding:38px;border:1px solid #d7d7d2;border-radius:16px;background:#fff;box-shadow:0 24px 70px #18181224}.setup-card{width:min(100%,760px)}.auth-card h1,.setup-card h1{margin:8px 0;font-size:29px}.auth-form,.setup-form{display:flex;flex-direction:column;gap:17px;margin-top:25px}.auth-form label,.setup-form label,.field{display:flex;flex-direction:column;gap:6px;color:#555;font-size:11px;font-weight:800}.auth-form input,.setup-form input,.field input,.field select,.field textarea{width:100%;min-height:40px;padding:9px 11px;border:1px solid #d2d2cc;border-radius:8px;background:#fff;outline:0}.auth-form input:focus,.setup-form input:focus,.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px #f0522d18}.setup-form fieldset{padding:18px;border:1px solid #ddd;border-radius:10px}.setup-form legend{padding:0 8px;font-size:12px;font-weight:900}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.wide{grid-column:1/-1}.alert{margin:18px 0;padding:12px 14px;border-radius:8px;font-size:12px}.alert.error{border:1px solid #f2b8b5;background:#fff1f0;color:var(--red)}.alert.success{border:1px solid #a7d7bd;background:#edf9f2;color:#17653f}.btn{min-height:38px;padding:0 14px;border:1px solid transparent;border-radius:8px;font-size:12px;font-weight:800}.btn.primary{background:var(--orange);color:#fff}.btn.dark{background:#1b1b1a;color:#fff}.btn.ghost{border-color:#d5d5d0;background:#fff}.btn.danger{border-color:#e8bab6;background:#fff;color:var(--red)}.btn:disabled{cursor:not-allowed;opacity:.55}.app-header{position:sticky;z-index:30;top:0;display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:74px;padding:11px 24px;border-bottom:1px solid var(--line);background:#fffffff5;backdrop-filter:blur(14px)}.header-brand,.header-actions,.nav-tabs{display:flex;align-items:center}.header-brand{gap:18px}.header-brand h1{margin:0;font-size:16px}.header-brand p{margin:3px 0 0;color:var(--muted);font-size:11px}.nav-tabs{gap:5px}.nav-tabs button{height:35px;padding:0 12px;border:0;border-radius:7px;background:transparent;color:#666;font-size:11px;font-weight:800}.nav-tabs button.active{background:#f0f0ed;color:var(--ink)}.header-actions{gap:9px}.user-chip{display:flex;flex-direction:column;align-items:flex-end;gap:2px;margin-right:4px;font-size:11px;font-weight:800}.user-chip small{color:#777;font-size:9px;font-weight:500}.page{min-height:calc(100vh - 74px);padding:26px}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;max-width:1280px;margin:0 auto 18px}.page-head h2{margin:0;font-size:25px}.page-head p{margin:5px 0 0;color:#777;font-size:12px}.panel{max-width:1280px;margin:auto;padding:20px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 2px 10px #14141008}.toolbar{display:grid;grid-template-columns:minmax(240px,1fr) 180px 180px auto;gap:10px;margin-bottom:16px}.toolbar input,.toolbar select{height:40px;padding:0 11px;border:1px solid #d5d5d0;border-radius:8px;background:#fff}.doc-table{width:100%;border-collapse:collapse}.doc-table th{padding:10px;color:#777;font-size:9px;letter-spacing:.07em;text-align:left;text-transform:uppercase}.doc-table td{padding:11px 10px;border-top:1px solid #ededeb;font-size:11px}.doc-table tr.clickable:hover{background:#fafaf8}.doc-table .amount{text-align:right;font-weight:800}.doc-type,.status-pill{display:inline-flex;padding:5px 8px;border-radius:999px;background:#eee;color:#555;font-size:9px;font-weight:900}.doc-type.invoice{background:#222;color:#fff}.status-pill.sent{background:#eaf1ff;color:#2855a1}.status-pill.accepted,.status-pill.paid{background:#e8f7ef;color:#17653f}.status-pill.declined{background:#fff0ef;color:#a62b23}.empty-state{padding:60px 20px;text-align:center}.empty-state h3{margin:0 0 8px}.editor-page{padding:0}.editor-header{position:sticky;z-index:25;top:74px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 20px;border-bottom:1px solid #d8d8d4;background:#f4f4f1f5}.editor-header>div{display:flex;align-items:center;gap:8px}.editor-header .save-state{color:#777;font-size:10px}.language-switch{display:flex;padding:3px;border:1px solid #d5d5d0;border-radius:8px;background:#e9e9e6}.language-switch button{width:34px;height:30px;padding:0;border:0;border-radius:6px;background:transparent;color:#777;font-size:10px;font-weight:900}.language-switch button.active{background:#fff;color:var(--orange);box-shadow:0 1px 4px #00000018}.workspace{display:grid;grid-template-columns:minmax(530px,.95fr) minmax(620px,1.05fr);min-height:calc(100vh - 130px)}.editor{display:flex;flex-direction:column;gap:14px;padding:22px;border-right:1px solid #d8d8d4;background:#f4f4f1}.card{padding:20px;border:1px solid var(--line);border-radius:12px;background:#fff}.step{display:flex;gap:12px;margin-bottom:17px}.step>b{display:grid;flex:0 0 27px;height:27px;place-items:center;border-radius:50%;background:var(--orange);color:#fff;font-size:12px}.step h2{margin:0;font-size:15px}.step p{margin:3px 0 0;color:var(--muted);font-size:12px}.segmented{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin-bottom:14px;padding:3px;border-radius:9px;background:#ededeb}.segmented button{min-height:35px;border:0;border-radius:7px;background:transparent;color:#6d6d67;font-size:12px;font-weight:800}.segmented button.active{background:#fff;color:var(--ink);box-shadow:0 1px 5px #00000014}.field>span{font-size:9px;letter-spacing:.05em;text-transform:uppercase}.template-row{display:grid;grid-template-columns:2fr .7fr auto;align-items:end;gap:10px}.template-row .btn{height:40px}.card small{display:block;margin-top:11px;color:#777;font-size:10px}.line-list{display:flex;flex-direction:column;gap:7px;margin-top:17px}.line{display:grid;grid-template-columns:96px 52px minmax(180px,1fr) 112px 92px;align-items:start;gap:7px;padding:8px;border:1px solid #dfdfdc;border-radius:9px;background:#fbfbfa}.line-section,.line-note{grid-template-columns:96px minmax(260px,1fr)}.line-section{margin-top:7px;border-left:4px solid var(--orange);background:#f3f3f0}.line-tools{display:grid;grid-template-columns:1fr repeat(3,21px);gap:3px}.line-tools select{height:30px;padding:0 3px;border:1px solid #d6d6d2;border-radius:5px;font-size:9px}.line-tools button{height:30px;padding:0;border:1px solid #ddd;border-radius:5px;background:#fff;color:#666}.line input,.line textarea{width:100%;border:1px solid #d6d6d2;border-radius:7px;background:#fff}.line .qty,.money input{height:34px;padding:0 8px;text-align:right}.line .desc{min-height:34px;resize:vertical;padding:7px 9px}.line-section .desc{font-weight:800;text-transform:uppercase}.line-note .desc{color:#666;font-size:11px;font-style:italic}.money{position:relative;display:block}.money input{padding-left:22px}.line>strong{padding-top:10px;font-size:11px;text-align:right}.text-actions{display:flex;flex-wrap:wrap;gap:16px;margin-top:14px}.text-actions button{padding:0;border:0;background:transparent;color:#d94321;font-size:11px;font-weight:800}.totals{display:grid;grid-template-columns:.6fr 1fr;gap:28px;margin-top:24px;padding-top:18px;border-top:1px solid #e3e3df}.totals dl{display:flex;flex-direction:column;gap:7px;margin:0}.totals dl div{display:flex;justify-content:space-between;color:#555;font-size:12px}.totals dl div:last-child{margin-top:2px;padding-top:8px;border-top:2px solid #222;color:var(--ink);font-weight:800}.preview{min-width:0;background:repeating-linear-gradient(135deg,#e5e5e2 0,#e5e5e2 1px,transparent 1px,transparent 12px)}.preview-bar{position:sticky;z-index:10;top:130px;display:flex;align-items:center;justify-content:space-between;height:50px;padding:0 22px;border-bottom:1px solid #d9d9d5;background:#f4f4f1f0}.preview-bar b{font-size:11px}.paper-wrap{padding:28px}.paper{display:flex;width:min(100%,760px);min-height:1075px;margin:auto;flex-direction:column;padding:52px 54px 36px;background:#fff;box-shadow:0 18px 48px #1616121f}.paper .brand-logo{font-size:23px}.paper-top{display:flex;justify-content:space-between}.paper-top>div:last-child{display:flex;flex-direction:column;gap:5px;padding-top:5px;color:#666;font-size:9px;text-align:right}.paper-top b{color:var(--orange);font-weight:500}.company{margin-top:46px;color:#595959;font-size:9px;line-height:1.45}.paper-title{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:22px;margin:9px 0 17px}.paper-title i{height:4px;background:var(--orange)}.paper-title h3{margin:0;font-size:14px;font-weight:500}.details{display:grid;grid-template-columns:1.45fr 1fr;gap:34px;font-size:8px}.details dl{display:flex;flex-direction:column;gap:5px;margin:0}.details dl div{display:grid;grid-template-columns:70px 1fr;gap:5px}.details dt{color:#555;font-weight:800}.details dd{min-height:12px;margin:0;padding-bottom:2px;border-bottom:1px solid #555}.paper h4{margin:29px 0 6px;font-size:13px;font-weight:500;text-transform:uppercase}.intro{margin:0 0 12px;color:#414141;font-size:7.5px;font-style:italic;line-height:1.55}.ptable{margin-top:16px;border:1px solid #555}.phead,.prow{display:grid;grid-template-columns:55px minmax(0,1fr) 82px 88px}.phead{border-bottom:1px solid #555;background:#f2f2f2;color:#555;font-size:7.5px;font-weight:800}.phead span,.prow span{padding:5px 6px;border-right:1px solid #777}.phead span:last-child,.prow span:last-child{border-right:0;background:#d3d3d3}.phead span:not(:nth-child(2)),.prow span:not(:nth-child(2)){text-align:right}.phead span:first-child,.prow span:first-child{text-align:center}.prow{min-height:23px;font-size:8px;line-height:1.35}.p-section{min-height:30px;padding-top:7px;font-weight:800;text-transform:uppercase}.p-note{min-height:20px;color:#555;font-size:7px;font-style:italic}.paper-bottom{display:grid;grid-template-columns:1fr 220px;gap:28px;margin-top:14px}.signature{display:flex;flex-direction:column;gap:21px;padding-top:4px;color:#555;font-size:7.5px}.signature i{width:125px;border-bottom:1px solid #555}.ptotals{display:flex;flex-direction:column;gap:4px;margin:0;font-size:8px}.ptotals div{display:flex;justify-content:space-between;gap:20px}.ptotals dd{min-width:78px;margin:0;text-align:right}.ptotals div:last-child{padding:4px 0;border-top:2px solid #222;border-bottom:2px solid #222;font-weight:800}.paper footer{display:flex;justify-content:space-between;gap:20px;margin-top:auto;padding-top:24px;color:#5c5c5c;font-size:7px}.modal-backdrop{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:20px;background:#1118}.modal{width:min(100%,620px);max-height:90vh;overflow:auto;padding:24px;border-radius:14px;background:#fff;box-shadow:0 24px 80px #0005}.modal h2{margin-top:0}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.user-list{display:flex;flex-direction:column;gap:8px}.user-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border:1px solid #ddd;border-radius:8px}.toast{position:fixed;z-index:200;right:20px;bottom:20px;max-width:360px;padding:12px 15px;border-radius:9px;background:#171717;color:#fff;font-size:12px;box-shadow:0 10px 35px #0004}.toast.error{background:#a62b23}
@media(max-width:1100px){.workspace{grid-template-columns:500px minmax(520px,1fr)}.nav-tabs{display:none}.line{grid-template-columns:86px 45px minmax(140px,1fr) 90px 75px}}@media(max-width:900px){.app-header{position:static;align-items:flex-start;flex-direction:column}.header-actions{width:100%;flex-wrap:wrap}.editor-header{position:static;flex-wrap:wrap}.workspace{display:block}.editor{border-right:0}.preview-bar{position:static}.toolbar{grid-template-columns:1fr 1fr}.doc-table{display:block;overflow:auto}}@media(max-width:640px){.page,.editor,.paper-wrap{padding-left:12px;padding-right:12px}.form-grid,.template-row,.totals,.toolbar{grid-template-columns:1fr}.line,.line-section,.line-note{grid-template-columns:1fr}.line-tools{grid-template-columns:minmax(120px,1fr) repeat(3,30px)}.paper{min-height:820px;padding:34px 30px 26px}.details{grid-template-columns:1fr;gap:10px}.phead,.prow{grid-template-columns:44px minmax(0,1fr) 65px 70px}.paper-bottom{grid-template-columns:1fr}.paper footer{flex-direction:column}.user-chip{display:none}}

