:root{font-family:Inter,Segoe UI,Arial,sans-serif;color:#172b3a;background:#f3f6f8;font-size:15px}*{box-sizing:border-box}body{margin:0;padding:0!important}main{max-width:1160px;margin:auto;padding:24px}header,.row,.section-title{display:flex;justify-content:space-between;align-items:center;gap:20px}.brand{font-weight:800;letter-spacing:1px}.brand span{color:#008a81}a{color:#007d77;text-decoration:none}header{padding:12px 0 28px;border-bottom:1px solid #dbe3e8}.hero{display:grid;grid-template-columns:2fr 1fr;gap:40px;padding:48px 0;align-items:center}h1{font-size:clamp(32px,4vw,52px);letter-spacing:-1.7px;line-height:1.1;margin:12px 0 22px}h2{font-size:22px}h3{margin:0;font-size:18px}.eyebrow{font-size:12px;letter-spacing:2px;font-weight:700;color:#008a81}p{line-height:1.6}.hero p{max-width:580px}.health{border-radius:16px;padding:24px;background:#fff2dc;border:1px solid #efd6a6}.health.online{background:#e3f4ee;border-color:#b7e0d0}.panel{background:white;border:1px solid #dce5e9;border-radius:18px;padding:28px;margin-bottom:20px;box-shadow:0 4px 18px #142d3d04}.upload{display:flex;flex-direction:column;gap:14px;background:#f3faf8;border:2px dashed #acd1c8;border-radius:12px;padding:28px;text-align:center;font-weight:700}input,textarea,select,button{font:inherit}input[type=file]{align-self:center;max-width:100%}label{display:block;margin:18px 0 10px;font-weight:600}textarea{display:block;width:100%;min-height:78px;margin-top:8px;border:1px solid #cbd8df;border-radius:9px;padding:12px}button{border:0;border-radius:9px;padding:13px 22px;background:#007e75;color:white;font-weight:700;cursor:pointer}.secondary{background:#e6eeee;color:#16443e}.check{display:flex;gap:10px;align-items:center}.muted,small,footer{color:#637783;font-size:13px}.error{background:#fff1ed;color:#9b3421;padding:12px;border-radius:8px}.badge{padding:8px 12px;background:#eef1f4;border-radius:30px;font-size:12px;font-weight:700;white-space:nowrap}.finalized{background:#d9f3e6;color:#12633d}.needs_review,.reconcile{background:#fff0cc;color:#805500}.amount{font-size:27px;font-weight:750}.table-wrap{overflow:auto;margin:20px 0}table{width:100%;border-collapse:collapse;text-align:left}td,th{padding:12px;border-bottom:1px solid #e7edf0;font-size:13px}td select{max-width:300px}td input{width:110px}input[type=number],select,input[type=password]{border:1px solid #cbd8df;border-radius:6px;padding:9px}summary{cursor:pointer;font-weight:700}.empty{text-align:center;color:#718491;padding:50px}footer{text-align:center;padding:25px}@media(max-width:700px){main{padding:16px}.hero{grid-template-columns:1fr;gap:16px;padding:30px 0}.panel{padding:20px}.row{align-items:flex-start;flex-wrap:wrap}h1{font-size:36px}button{width:100%}}
.processing-progress ol{display:flex;list-style:none;padding:0;gap:4px;flex-wrap:wrap;margin:20px 0 8px}.processing-progress li{flex:1;min-width:100px;border-top:5px solid #e4e9ed;padding:10px 4px;font-size:12px;color:#637783}.processing-progress li.complete{border-color:#008a81}.processing-progress li.current{border-color:#008a81;background:#e3f4ee;color:#005950;font-weight:700}
:root{font-size:16px}html{scroll-behavior:smooth;scroll-padding-top:20px}body{overflow-wrap:anywhere}button,.button{min-height:48px;touch-action:manipulation}.button{display:inline-flex;align-items:center;justify-content:center;border-radius:9px;padding:12px 16px;font-weight:700}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #e3ac36;outline-offset:3px}button:disabled{opacity:.5;cursor:default}input:not([type=checkbox]):not([type=hidden]):not([type=file]),select{width:100%;min-height:48px;padding:12px;border:1px solid #beced5;border-radius:9px;background:#fff;color:#172b3a;font-size:16px}textarea{font-size:16px}input[type=checkbox]{width:22px;height:22px;flex:none;accent-color:#007e75}.full{width:100%}.header-actions{display:flex;align-items:center;gap:10px}.header-actions form{margin:0}.header-actions button{width:auto}.auth-main{max-width:500px;padding-top:40px}.auth-main .brand{margin-bottom:32px}.auth-main h1{font-size:36px}.password-field{display:flex;align-items:stretch;gap:8px}.password-field input{min-width:0;flex:1}.password-toggle{width:auto!important;flex:none;padding:12px}.login-submit{margin-top:24px}.success{background:#def4e8;color:#135338;padding:16px;border-radius:10px}.user-row{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid #dde5e9;padding:16px 0}.user-row p{margin:6px 0}.capture-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.capture-button{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;background:#007e75;color:white;border-radius:12px;min-height:64px;padding:16px;cursor:pointer;text-align:center;margin:8px 0;font-weight:750;overflow:hidden}.capture-button.secondary{background:#e6eeee;color:#16443e}.file-overlay{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}.capture-button:focus-within{outline:3px solid #e3ac36;outline-offset:3px}.invoice-preview{display:block;max-height:360px;max-width:100%;width:auto;margin:20px auto;border:1px solid #dce5e9;border-radius:10px;object-fit:contain}.invoice-preview[hidden],progress[hidden]{display:none}progress{width:100%;height:18px;accent-color:#007e75}#upload-status{font-size:14px;color:#435e6e;min-height:24px}.mobile-nav{display:none}#kuf tfoot th{font-size:15px}.item-table td select{max-width:100%}
@media(max-width:700px){main{padding:16px 14px calc(90px + env(safe-area-inset-bottom))}header{padding:4px 0 16px;gap:10px}.brand{font-size:12px;letter-spacing:.7px}.header-actions{gap:6px}.header-actions .button,.header-actions button{font-size:13px;padding:10px;min-height:44px}.hero{padding:22px 0;gap:14px}.hero h1{font-size:33px;letter-spacing:-1px;margin:8px 0 16px}.hero p{font-size:15px;margin:8px 0}.hero .health{padding:14px 16px}.health p{font-size:13px}.panel{padding:18px;border-radius:14px;margin-bottom:16px}h2{font-size:21px;margin-top:4px}h3{font-size:18px}.capture-actions{grid-template-columns:1fr}.capture-button{min-height:60px;margin:2px 0}.capture-button.secondary{min-height:52px}.check{align-items:flex-start;line-height:1.45}.section-title{gap:12px;align-items:baseline}.section-title a{font-size:13px;min-height:44px;display:flex;align-items:center}.row{gap:8px}.badge{font-size:12px}.amount{margin:14px 0}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;justify-content:space-around;background:#fff;border-top:1px solid #d5e2e4;padding:6px 6px calc(6px + env(safe-area-inset-bottom));z-index:20;box-shadow:0 -3px 16px #172b3a0a}.mobile-nav a{flex:1;min-height:48px;display:flex;justify-content:center;align-items:center;font-size:13px;font-weight:750;border-radius:8px}.mobile-nav a:active{background:#def3ee}.processing-progress ol{gap:2px;flex-wrap:nowrap}.processing-progress li{min-width:0;font-size:10px;padding:8px 2px;overflow-wrap:normal}.table-wrap{overflow:visible;margin:16px 0}.table-wrap table,.table-wrap tbody,.table-wrap tr,.table-wrap td{display:block;width:100%}.table-wrap thead{display:none}.table-wrap tbody tr{border:1px solid #dce5e9;border-radius:12px;padding:10px 12px;margin-bottom:12px}.table-wrap td{padding:8px 0;border:0;font-size:15px}.table-wrap td[data-label]::before{content:attr(data-label);display:block;font-size:11px;font-weight:700;color:#637783;margin-bottom:4px;text-transform:uppercase;letter-spacing:.6px}.table-wrap td select,.table-wrap td input{max-width:100%;width:100%}.table-wrap tfoot{display:block;background:#e3f4ee;border-radius:10px;padding:12px}.table-wrap tfoot tr{display:flex;flex-wrap:wrap;gap:8px}.table-wrap tfoot th{display:block;border:0;padding:4px;font-size:14px}.table-wrap tfoot th:first-child{width:100%}#kuf tfoot th:nth-child(2)::before{content:'Osnovica: ';font-weight:400}#kuf tfoot th:nth-child(3)::before{content:'PDV: ';font-weight:400}#kuf tfoot th:nth-child(4)::before{content:'Ukupno: ';font-weight:400}#kuf td[data-label="Ukupno KM"]{font-size:23px;font-weight:750;color:#00695f}.user-row{align-items:flex-start;flex-wrap:wrap}.user-row button{width:auto}.auth-main{padding-top:max(28px,env(safe-area-inset-top));min-height:100dvh}.auth-main .brand{margin-bottom:24px}.auth-main .panel{padding:22px}.auth-main h1{font-size:32px}.auth-page main{padding-bottom:24px}footer{font-size:12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.conversation{border-top:1px solid #dde8e9;padding-top:16px;margin-top:20px}.conversation summary{min-height:44px;display:flex;align-items:center;color:#007d77}.chat-message{padding:14px 16px;border-radius:12px;background:#f0f5f7;margin:12px 0;font-size:14px;max-width:90%}.chat-message p{margin:6px 0;white-space:normal}.chat-message.from-user{margin-left:auto;background:#ddf3eb}.chat-message b{font-size:12px}.reply-form{background:#f5f9fa;border:1px solid #e0e9ed;border-radius:12px;padding:16px;margin:16px 0}.reply-form label{margin-top:0}.reply-form button{margin-top:12px}
:root{background:#edf3f5;color:#17313d;font-family:"Segoe UI",Arial,sans-serif}body{background:radial-gradient(ellipse at 88% 0,#cce9e6 0,transparent 40%),#edf3f5}.brand{display:flex;gap:10px;align-items:center;letter-spacing:1.5px}.brand-icon{display:grid;place-items:center;background:#073d3a;color:#5ce4ca!important;width:40px;height:40px;border-radius:12px;font-size:25px;font-weight:900;box-shadow:inset 0 0 0 1px #ffffff30}.brand-caption{display:block;font-size:9px;letter-spacing:1.2px;margin-top:5px;color:#5c747e!important}header{border:0;padding-bottom:22px}.hero{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(120deg,#082e39,#07463f);color:#effffe;border-radius:24px;padding:36px;margin:0 0 26px;grid-template-columns:1.2fr 1fr;gap:30px;box-shadow:0 12px 32px #082e3917}.hero::before{content:'';position:absolute;inset:0;z-index:-1;background-image:radial-gradient(#ffffff15 1px,transparent 1px);background-size:22px 22px;mask-image:linear-gradient(90deg,transparent,#000)}.hero h1{font-weight:800;font-size:44px;letter-spacing:-1.7px;margin:16px 0}.hero p{color:#bfddd9}.hero .eyebrow{color:#6ce6ce;font-size:10px;letter-spacing:1.5px}.live-dot{display:inline-block;width:7px;height:7px;background:#6ce6ce;border-radius:50%;margin-right:7px;box-shadow:0 0 0 4px #6ce6ce17}.hero-side{min-width:0}.invoice-graphic svg{width:100%;height:auto;max-height:160px}.graphic-labels{display:flex;justify-content:space-around;color:#9ccfc7;font-size:8px;letter-spacing:1px;margin-bottom:18px}.hero .health{background:#ffffff0a;border:1px solid #ffffff23;padding:14px 17px;border-radius:12px;box-shadow:none}.hero .health b{color:#ffdf9d;font-size:14px}.hero .health.online b{color:#6de9cb}.hero .health p{font-size:12px;margin:6px 0}.hero .health small{font-size:10px;color:#8fbeb7}.panel{border:1px solid #dae5e9;box-shadow:0 7px 24px #163d4705}.capture-button{background:linear-gradient(110deg,#007e75,#00978c);box-shadow:0 5px 14px #007e7522}.capture-button.secondary{box-shadow:none}.auth-page{background:radial-gradient(ellipse at 50% 0,#d2f0e9,transparent 65%),#edf3f5}.auth-main .panel{box-shadow:0 16px 50px #073d3a0c}.processing-progress li.current{border-radius:0 0 6px 6px}.mobile-nav a{color:#37616b}.mobile-nav a:first-child{color:#00776e;background:#e5f7f2}
@media(max-width:700px){.hero{display:flex;flex-direction:column;align-items:stretch;padding:24px 20px;border-radius:19px;margin-bottom:18px;gap:16px}.hero h1{font-size:36px;line-height:1.08;margin:14px 0}.hero p{font-size:14px}.hero-side{display:flex;flex-direction:column}.invoice-graphic{max-width:340px;width:100%;margin:0 auto}.invoice-graphic svg{max-height:105px}.graphic-labels{margin-bottom:14px;font-size:7px}.hero .health{padding:12px 14px}.hero .health p{font-size:12px}.brand{letter-spacing:1px}.brand-icon{width:34px;height:34px;border-radius:10px;font-size:22px}.brand-caption{font-size:7px;letter-spacing:.6px}.header-actions .button,.header-actions button{padding:9px 8px;font-size:12px}.capture-button{min-height:62px}.panel{padding:18px}.auth-main .brand{font-size:14px}.auth-main .brand span{color:#008a81}}

.scan-launch{margin:0 0 12px;background:linear-gradient(120deg,#007e75,#174a82);min-height:64px;font-size:1.1rem}
.scan-dialog{width:min(620px,100%);max-width:100%;max-height:100dvh;margin:auto;border:0;border-radius:20px;padding:20px;color:#15384c;background:#fff;overflow:auto;box-sizing:border-box}
dialog::backdrop{background:rgba(9,24,37,.88)}
.scan-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.scan-view{position:relative;background:#08151f;border-radius:14px;overflow:hidden;line-height:0}
.scan-view video{display:block;width:100%;max-height:58dvh;object-fit:contain}
.scan-guide{position:absolute;inset:7%;border:2px dashed #5ef3c9;border-radius:9px;pointer-events:none;box-shadow:0 0 0 40px #0003}
.scan-view video{height:58dvh;max-height:58dvh;object-fit:contain}
.scan-guide{inset:auto;left:50%;top:50%;width:0;height:0;border-radius:2px;box-shadow:0 0 0 100vmax #0006}
.scan-guide::before{content:'A4 · 210 × 297 mm';position:absolute;left:0;right:0;top:-25px;line-height:20px;color:#fff;font-size:12px;text-align:center;text-shadow:0 1px 3px #000}
.scan-guide.ready{border:3px solid #5ef3c9}
#connection-notice{position:sticky;top:0;z-index:30}#connection-notice a{text-decoration:underline;font-weight:700}
#scan-status{min-height:48px;font-weight:650}#scan-progress{width:100%;height:10px;accent-color:#007e75}
.preview-dialog{width:96vw;max-width:1400px;max-height:95dvh;border:0;border-radius:16px;padding:16px;box-sizing:border-box}
.preview-scroll{overflow:auto;max-height:75dvh;background:#173245;touch-action:pan-x pan-y pinch-zoom}
#preview-large{max-width:none;width:auto;height:auto;display:block}
[hidden]{display:none!important}
@media(max-width:600px){.scan-dialog{border-radius:0;min-height:100dvh;padding:16px;padding-bottom:max(20px,env(safe-area-inset-bottom))}.scan-view video{max-height:52dvh}.capture-actions>*{min-height:50px}}
@media(max-width:600px){.scan-dialog{width:100%;height:100dvh;display:flex;flex-direction:column;gap:8px}.scan-dialog:not([open]){display:none}.scan-dialog header{margin:0;padding:0}.scan-view{flex:1;min-height:230px}.scan-view video{height:100%;max-height:none}.scan-dialog p{margin:4px 0}.scan-dialog .check{margin:4px 0}.scan-dialog .capture-actions{grid-template-columns:1fr 1fr}.scan-dialog .muted{font-size:11px;line-height:1.3}}

.badge.adjustment_required{background:#fff0cc;color:#805500}
