:root{--bg:#fff;--surface:#fff;--surface2:#f8f9fb;--border:#e5e7eb;--text:#101828;--text-dim:#6b7280;--accent:#3d56ff;--accent2:#0ea5a4;--green:#0ea5a4;--red:#dc2626;--orange:#ff8524;--blue:#3d56ff;--yellow:#ffc923;--navy:#0f2a44;--btn-dark:#32373c}*{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);font-family:Inter Tight,Inter,-apple-system,BlinkMacSystemFont,sans-serif;line-height:1.6}.app{max-width:1400px;margin:0 auto;padding:2rem}header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;margin-bottom:2rem;padding-bottom:1.5rem;display:flex}header h1{color:var(--navy);background:0 0;-webkit-background-clip:unset;-webkit-text-fill-color:unset;font-size:1.5rem;font-weight:700}.badge{letter-spacing:.05em;text-transform:uppercase;border-radius:999px;padding:.25rem .75rem;font-size:.75rem;font-weight:600;display:inline-block}.badge.green{color:var(--green);background:#0ea5a41f}.badge.blue{color:var(--blue);background:#3d56ff1a}.stats-grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin-bottom:2rem;display:grid}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:1.25rem;position:relative;overflow:hidden;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.stat-card:after{content:"";background:linear-gradient(90deg, var(--yellow), var(--accent2));height:3px;position:absolute;top:0;left:0;right:0}.stat-card .label{color:var(--text-dim);text-transform:uppercase;letter-spacing:.08em;margin-bottom:.5rem;font-size:.7rem}.stat-card .value{font-variant-numeric:tabular-nums;color:var(--navy);font-size:1.75rem;font-weight:700}.stat-card .sub{color:var(--text-dim);margin-top:.25rem;font-size:.8rem}.section{margin-bottom:2rem}.section-title{color:var(--navy);align-items:center;gap:.5rem;margin-bottom:1rem;font-size:1.1rem;font-weight:600;display:flex}.currency-tabs{gap:.5rem;margin-bottom:1.5rem;display:flex}.currency-tab{border:1px solid var(--border);background:var(--surface);color:var(--text-dim);cursor:pointer;border-radius:8px;padding:.5rem 1.25rem;font-size:.85rem;font-weight:600;transition:all .2s}.currency-tab:hover{border-color:var(--accent);color:var(--text)}.currency-tab.active{background:var(--yellow);border-color:var(--yellow);color:var(--navy)}table{border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:12px;width:100%;overflow:hidden;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}thead th{background:var(--surface2);text-align:left;text-transform:uppercase;letter-spacing:.08em;color:var(--text-dim);padding:.75rem 1rem;font-size:.7rem;font-weight:600}thead th.right,tbody td.right{text-align:right}tbody td{border-top:1px solid var(--border);font-variant-numeric:tabular-nums;padding:.75rem 1rem;font-size:.9rem}tbody tr.total td{border-top:2px solid var(--border);background:var(--surface2);font-weight:700}.vat-check{background:var(--surface);border:1px solid var(--border);border-radius:12px;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:1rem;padding:1.25rem;display:grid;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.vat-item .label{color:var(--text-dim);text-transform:uppercase;letter-spacing:.08em;font-size:.7rem}.vat-item .value{font-variant-numeric:tabular-nums;font-size:1.25rem;font-weight:700}.vat-item .value.match{color:var(--green)}.vat-item .value.warn{color:var(--orange)}.manual-entry{background:var(--surface);border:1px solid var(--border);border-radius:12px;margin-bottom:1rem;overflow:hidden;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.manual-entry-header{background:var(--surface2);color:var(--navy);justify-content:space-between;align-items:center;padding:1rem 1.25rem;font-weight:600;display:flex}.entry-line{border-top:1px solid var(--border);grid-template-columns:80px 70px 1fr 150px 160px;align-items:center;padding:.6rem 1.25rem;font-size:.85rem;display:grid}.side-badge{text-transform:uppercase;border-radius:4px;padding:.15rem .5rem;font-size:.7rem;font-weight:700;display:inline-block}.side-badge.debit{color:var(--blue);background:#3d56ff1a}.side-badge.credit{color:var(--green);background:#0ea5a41f}.amount{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}.journal-grid{grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:.75rem;display:grid}.je-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;justify-content:space-between;align-items:center;padding:1rem;display:flex;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.je-card .je-id{color:var(--navy);font-size:.9rem;font-weight:600}.je-card .je-type{color:var(--text-dim);font-size:.8rem}.je-card .je-amount{font-variant-numeric:tabular-nums;font-weight:700}.flow-container{flex-wrap:wrap;justify-content:center;align-items:center;gap:1rem;margin:2rem 0;display:flex}.flow-node{background:var(--surface);border:1px solid var(--border);text-align:center;border-radius:12px;min-width:140px;padding:1rem 1.5rem;transition:border-color .4s,box-shadow .4s;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.flow-node .icon{margin-bottom:.25rem;font-size:1.5rem;transition:color .4s}.flow-node .name{color:var(--navy);font-size:.85rem;font-weight:600;transition:color .4s}.flow-node .detail{color:var(--text-dim);font-size:.7rem}.flow-node.completed{border-color:var(--green);box-shadow:0 0 12px #0ea5a433}.flow-node.completed .icon,.flow-node.completed .name{color:var(--green)}.flow-arrow{color:var(--accent);font-size:1.5rem;transition:color .4s}.flow-arrow.completed{color:var(--green)}.clickable{cursor:pointer;transition:background .15s}.clickable:hover{background:var(--surface2)}.expand-icon{color:var(--text-dim);text-align:center;-webkit-user-select:none;user-select:none;width:30px;font-size:.65rem}.sub-row td{background:var(--surface2);border-top:1px solid var(--border);padding:.5rem 1rem;font-size:.8rem}.sub-cell{color:var(--text-dim)}.group-start td{border-top:3px solid var(--border)}.currency-cell{vertical-align:top;padding-top:.85rem}.period-sub{color:var(--text-dim);font-size:.7rem}.vat-code{color:var(--text-dim);font-size:.8rem}.fetch-panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;margin-bottom:2rem;overflow:hidden;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.fetch-header{padding:1.25rem}.fetch-input-row{gap:.75rem;display:flex}.run-select{border:1px solid var(--border);background:var(--surface2);color:var(--text);cursor:pointer;border-radius:8px;outline:none;flex:1;padding:.6rem 1rem;font-size:.9rem;transition:border-color .2s}.run-select:focus{border-color:var(--accent)}.run-select option{background:var(--surface2);color:var(--text)}.fetch-input-row input{border:1px solid var(--border);background:var(--surface2);width:160px;color:var(--text);border-radius:8px;outline:none;padding:.6rem 1rem;font-size:.9rem;transition:border-color .2s}.fetch-input-row input:focus{border-color:var(--accent)}.fetch-input-row input::placeholder{color:var(--text-dim)}.fetch-btn{background:var(--btn-dark);color:#fff;cursor:pointer;white-space:nowrap;border:none;border-radius:8px;padding:.6rem 1.5rem;font-size:.85rem;font-weight:600;transition:all .2s}.fetch-btn:hover:not(:disabled){background:#444a50}.fetch-btn:disabled{opacity:.5;cursor:not-allowed}.refetch-btn{background:var(--surface2);border:1px solid var(--border);color:var(--text)}.refetch-btn:hover:not(:disabled){background:var(--border)}.fetch-logs{background:var(--surface2);border-top:1px solid var(--border);max-height:200px;padding:.75rem 1.25rem;font-family:SF Mono,Fira Code,monospace;font-size:.75rem;overflow-y:auto}.log-line{color:var(--text-dim);padding:.15rem 0}.log-error{color:var(--red)}.progress-bar{background:var(--border);border-radius:2px;height:3px;margin-bottom:.5rem;overflow:hidden}.progress-fill{background:linear-gradient(90deg, var(--yellow), var(--accent2));border-radius:2px;height:100%}.bexio-actions{flex-wrap:wrap;gap:1rem;margin-top:1rem;display:flex}.bexio-btn{color:#fff;align-items:center;gap:.4rem;display:flex;background:var(--green)!important;border-color:var(--green)!important}.bexio-btn:hover:not(:disabled){filter:brightness(1.15)}.bexio-result{color:var(--green);background:#0ea5a41a;border-radius:8px;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.85rem;display:flex}.success-icon{color:var(--green)}.bexio-link{color:var(--accent2);align-items:center;gap:.3rem;margin-left:.5rem;font-weight:500;text-decoration:none;display:inline-flex}.bexio-link:hover{text-decoration:underline}.bexio-error{color:var(--red);padding:.25rem 0;font-size:.85rem}.bexio-post-row{align-items:center;gap:.75rem;display:flex}.sheet-meta{flex-wrap:wrap;align-items:center;gap:.75rem;margin-bottom:1rem;font-size:.85rem;display:flex}.sheet-table-wrap{border:1px solid var(--border);border-radius:12px;max-height:500px;overflow:auto;box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a}.sheet-table-wrap table{box-shadow:none;border:none;border-radius:0}.sheet-table-wrap thead th{z-index:1;position:sticky;top:0}.text-dim{color:var(--text-dim);font-size:.85rem}.badge-sm{background:var(--surface2);color:var(--text-dim);border-radius:4px;padding:.1rem .4rem;font-size:.65rem;display:inline-block}.expanded-row td{background:var(--surface2);font-size:.8rem}.sums-layout{gap:2rem;display:flex}.sums-with-ar .sums-left{flex:1;min-width:0}.sums-right{flex:none;min-width:380px}.sums-right table{font-size:.82rem}.sums-right td,.sums-right th{padding:.4rem .6rem}.subtotal td{border-top:1px solid var(--border);background:var(--surface2);font-weight:600}@media (width<=1100px){.sums-layout{flex-direction:column}.sums-right{min-width:0}}.bexio-confirm{background:#ff852414;border:1px solid #ff85244d;border-radius:8px;flex-wrap:wrap;align-items:center;gap:.75rem;padding:.75rem 1rem;display:flex}.bexio-confirm-msg{color:var(--text);font-size:.85rem}.bexio-btn-warn{background:var(--orange)!important;border-color:var(--orange)!important;color:#fff!important}.settings-btn{background:var(--surface);border:1px solid var(--border);cursor:pointer;width:36px;height:36px;color:var(--text-dim);border-radius:8px;justify-content:center;align-items:center;transition:all .2s;display:flex}.settings-btn:hover{border-color:var(--accent);color:var(--accent)}.mappings-overlay{z-index:1000;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#00000080;justify-content:center;align-items:flex-start;padding:3rem 1rem;display:flex;position:fixed;inset:0;overflow-y:auto}.mappings-panel{background:var(--bg);border:1px solid var(--border);border-radius:16px;width:100%;max-width:1100px;max-height:calc(100vh - 6rem);overflow-y:auto;box-shadow:0 24px 48px #00000026}.mappings-header{border-bottom:1px solid var(--border);background:var(--bg);z-index:1;border-radius:16px 16px 0 0;justify-content:space-between;align-items:flex-start;padding:1.5rem;display:flex;position:sticky;top:0}.mappings-header h2{color:var(--navy);font-size:1.25rem;font-weight:600}.mappings-subtitle{color:var(--text-dim);font-size:.8rem}.mappings-close-btn{background:var(--surface);border:1px solid var(--border);cursor:pointer;width:32px;height:32px;color:var(--text-dim);border-radius:8px;justify-content:center;align-items:center;font-size:1rem;transition:all .2s;display:flex}.mappings-close-btn:hover{border-color:var(--red);color:var(--red)}.mappings-reset-btn{background:var(--surface);border:1px solid var(--border);cursor:pointer;color:var(--text-dim);border-radius:8px;padding:.4rem .8rem;font-size:.75rem;font-weight:600;transition:all .2s}.mappings-reset-btn:hover{border-color:var(--orange);color:var(--orange)}.mappings-content{padding:1rem 1.5rem 1.5rem}.mapping-group{margin-bottom:1.5rem}.mapping-group-header{justify-content:space-between;align-items:center;margin-bottom:.75rem;display:flex}.mapping-group-header h3{color:var(--navy);margin-bottom:.15rem;font-size:.95rem;font-weight:600}.mapping-group-desc{color:var(--text-dim);font-size:.7rem}.mapping-add-btn{background:var(--surface);border:1px solid var(--border);cursor:pointer;color:var(--accent);border-radius:6px;padding:.35rem .75rem;font-size:.75rem;font-weight:600;transition:all .2s}.mapping-add-btn:hover{border-color:var(--accent);background:#3d56ff0f}.mappings-table{border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:10px;width:100%;font-size:.85rem;overflow:hidden}.mappings-table thead th{background:var(--surface2);text-align:left;text-transform:uppercase;letter-spacing:.08em;color:var(--text-dim);padding:.5rem .6rem;font-size:.65rem;font-weight:600}.mappings-table tbody td{border-top:1px solid var(--border);padding:.3rem .4rem}.mapping-input{width:100%;color:var(--text);background:0 0;border:1px solid #0000;border-radius:6px;outline:none;padding:.35rem .5rem;font-family:inherit;font-size:.8rem;transition:all .15s}.mapping-input:hover{background:var(--surface2)}.mapping-input:focus{border-color:var(--accent);background:var(--bg)}.mapping-input-sm{text-align:center;max-width:80px}select.mapping-input{cursor:pointer;appearance:auto}.add-mapping-fields select{border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;border-radius:8px;outline:none;padding:.5rem .75rem;font-family:inherit;font-size:.9rem;transition:border-color .2s}.add-mapping-fields select:focus{border-color:var(--accent)}.mapping-saving{opacity:.5}.mapping-delete-btn{color:var(--text-dim);cursor:pointer;background:0 0;border:none;border-radius:4px;padding:.25rem .4rem;font-size:.8rem;transition:all .15s}.mapping-delete-btn:hover{color:var(--red);background:#dc262614}.add-mapping-backdrop{z-index:1100;background:#0006;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.add-mapping-modal{background:var(--bg);border:1px solid var(--border);border-radius:14px;width:100%;max-width:480px;padding:1.5rem;box-shadow:0 16px 40px #00000026}.add-mapping-modal h3{color:var(--navy);margin-bottom:1rem;font-size:1.1rem;font-weight:600}.add-mapping-fields{flex-direction:column;gap:.75rem;display:flex}.add-mapping-fields label{color:var(--text-dim);text-transform:uppercase;letter-spacing:.05em;flex-direction:column;gap:.25rem;font-size:.75rem;font-weight:600;display:flex}.add-mapping-fields input{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;outline:none;padding:.5rem .75rem;font-family:inherit;font-size:.9rem;transition:border-color .2s}.add-mapping-fields input:focus{border-color:var(--accent)}.add-mapping-actions{justify-content:flex-end;gap:.75rem;margin-top:1.25rem;display:flex}.post-preview-modal{background:var(--bg);border:1px solid var(--border);border-radius:14px;width:100%;max-width:640px;padding:1.5rem;box-shadow:0 16px 40px #00000026}.post-preview-modal h3{color:var(--navy);margin-bottom:1rem;font-size:1.1rem;font-weight:600}.post-preview-meta{background:var(--surface2);border-radius:10px;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:1rem;padding:1rem;display:grid}.post-preview-meta>div{flex-direction:column;gap:.2rem;display:flex}.post-preview-meta .text-dim{text-transform:uppercase;letter-spacing:.08em;font-size:.65rem}.post-preview-meta strong{color:var(--navy);font-size:.9rem}.post-preview-table{border-collapse:collapse;border:1px solid var(--border);border-radius:8px;width:100%;margin-bottom:.5rem;font-size:.85rem;overflow:hidden}.post-preview-table thead th{background:var(--surface2);text-align:left;text-transform:uppercase;letter-spacing:.08em;color:var(--text-dim);padding:.5rem .75rem;font-size:.65rem;font-weight:600}.post-preview-table tbody td{border-top:1px solid var(--border);padding:.5rem .75rem}.login-screen{background:var(--surface2);justify-content:center;align-items:center;min-height:100vh;display:flex}.login-box{background:var(--bg);border:1px solid var(--border);text-align:center;border-radius:16px;width:100%;max-width:380px;padding:2.5rem;box-shadow:0 8px 24px #00000014}.login-box h1{color:var(--navy);margin-bottom:.25rem;font-size:1.3rem;font-weight:700}.login-box p{margin-bottom:1.5rem}.login-box input[type=password]{border:1px solid var(--border);background:var(--surface);width:100%;color:var(--text);border-radius:8px;outline:none;margin-bottom:1rem;padding:.7rem 1rem;font-family:inherit;font-size:1rem;transition:border-color .2s}.login-box input:focus{border-color:var(--accent)}.login-error{color:var(--red);margin-bottom:.75rem;font-size:.85rem}
