:root{--ink:#192631;--paper:#faf9f5;--line:#dcded9;--muted:#57656b;--warm:#ebdfd0;--nav:#192631;--white:#fff;--ok:#286348}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--paper);font:15px/1.5 "DM Sans",Arial,sans-serif}a{color:inherit}h1,h2,h3{font-family:Manrope,Arial,sans-serif;line-height:1.15;letter-spacing:-.035em;margin:0 0 .65em}h1{font-size:clamp(27px,3vw,44px)}h2{font-size:22px}p{margin:.5em 0 1em}.shell{display:grid;grid-template-columns:232px minmax(0,1fr);min-height:100vh}aside{background:var(--nav);color:#fff;padding:32px 22px;display:flex;flex-direction:column;gap:18px}.brand{font-family:Manrope,Arial,sans-serif;color:inherit;font-size:35px;line-height:1;font-weight:700;letter-spacing:-.075em;text-decoration:none}.brand span{display:block;font-size:10px;margin-top:6px;letter-spacing:.23em;text-transform:uppercase}.side-title{font-size:13px;color:#d7ddd9;margin-top:18px}nav{display:grid;gap:2px}nav a{padding:9px 12px;text-decoration:none;border-radius:5px}nav .sub{font-size:14px;padding-left:27px;color:#dce1e1}nav .on,nav a:hover{background:#30404a}aside>form{margin-top:auto}.logout{background:transparent;color:#fff;border-color:#596970}main{padding:24px clamp(16px,4vw,70px) 55px;min-width:0}.top,header,.dochead{display:flex;justify-content:space-between;align-items:center;gap:16px}.top{font-size:13px;color:var(--muted);padding-bottom:20px;border-bottom:1px solid var(--line)}.state,.pill{font-size:12px;padding:4px 9px;border-radius:20px;background:#eceee9}.notice{padding:12px 16px;background:#f1e9dc;border-left:3px solid #a18766;margin:20px 0;border-radius:3px}.notice a{margin-left:10px}header{margin:32px 0 18px}header h1{margin:0}.panel,.paper,.authbox{background:var(--white);border:1px solid var(--line);border-radius:9px;padding:clamp(15px,2vw,29px);margin-bottom:16px}.filter{display:flex;gap:15px;align-items:end;flex-wrap:wrap}.filter label:first-child{flex:1}.form{max-width:840px}.pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.pair.tight{gap:12px}.pair .form{max-width:none}input,textarea,select,button,.primary,.secondary{font:inherit;border:1px solid #bac2c0;border-radius:5px;color:var(--ink);background:#fff;padding:9px 12px}.primary,.secondary{display:inline-block;text-align:center;text-decoration:none}.primary{background:var(--ink);border-color:var(--ink);color:#fff}.new{background:var(--warm);color:var(--ink)}button,.primary,.secondary{cursor:pointer;font-weight:650}button:disabled{opacity:.46;cursor:default}label{display:flex;flex-direction:column;gap:5px;font-weight:550;font-size:14px;color:var(--muted);margin:8px 0 12px}label input,label select,label textarea{width:100%;min-width:0;font-weight:400}.filter label{margin-bottom:0}textarea{min-height:62px}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:2px solid #406675;outline-offset:2px}.check{flex-direction:row;align-items:center}.check input{width:18px;height:18px}.scroll{overflow:auto}.panel .scroll{margin:12px 0}table{border-collapse:collapse;width:100%;font-size:14px}td,th{padding:10px 8px;text-align:left;border-bottom:1px solid var(--line)}th{font-size:12px;color:var(--muted);font-weight:650;background:#f5f5f1}.empty{text-align:center;padding:34px;color:var(--muted)}#lines :is(input,select){width:75px}#lines td:first-child input{min-width:180px;width:100%}.paper{padding:clamp(20px,4vw,52px)}.dochead{align-items:start;border-bottom:2px solid var(--ink);padding-bottom:15px}.dochead>div:last-child{text-align:right}.parties{margin:24px 0}.parties strong,.parties small{display:block}.parties small,.small{color:var(--muted)}.tax{width:auto;margin:25px 0 25px auto}.auth{min-height:100vh;display:grid;place-items:center;padding:16px}.authbox{width:min(420px,100%);padding:36px}.authbox .brand{margin-bottom:36px}.authbox .primary{width:100%;margin-top:12px}.authbox h1{font-size:32px}.authbox p{color:var(--muted)}
@media(max-width:820px){.shell{display:block}aside{padding:16px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}aside .brand{font-size:26px}.side-title{display:none}aside nav{grid-column:1/-1;display:flex;overflow:auto;white-space:nowrap}aside nav .sub{display:none}aside>form{margin:0}.logout{padding:5px 10px}main{padding:18px 14px}.pair{grid-template-columns:1fr}.pair.tight{grid-template-columns:1fr 1fr}header{align-items:start;flex-wrap:wrap}.filter{gap:8px}.filter label:first-child{flex-basis:100%}.paper .pair{grid-template-columns:1fr 1fr}}@page{size:A4;margin:12mm}@media print{body{background:white;color:black;font:10pt Arial,sans-serif}.shell{display:block}.shell aside,.top,.notice,.noprint{display:none!important}main,.paper{padding:0;margin:0;border:0}.dochead,.pair{display:flex;justify-content:space-between}.paper .parties>div{width:47%}.scroll{overflow:visible}table{font-size:9pt}th,td{padding:4px}thead{display:table-header-group}tr{break-inside:avoid}.paper h2{font-size:18pt}.paper .tax{break-inside:avoid}}

.qr{display:grid;justify-items:start;gap:4px;break-inside:avoid}.qr img{width:34mm;height:34mm}.qr strong{font-size:11px}

.invoice-preview{display:block;width:100%;height:84vh;min-height:420px;border:0;background:#fff;margin-bottom:1.5rem}
