:root{--bg:#f5f6f8;--surface:#ffffff;--surface-2:#f9fafb;--border:#e4e7ec;--border-strong:#d0d5dd;--text:#101828;--text-2:#475467;--muted:#667085;--primary:#155eef;--primary-hover:#004eeb;--primary-soft:#eff4ff;--pos:#067647;--neg:#c01048;--neg-soft:#fff1f3;--warn-soft:#fffaeb;--hist-bg:#f8f9fb;--override:#f79009;--radius:10px;--shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);--shadow-lg:0 12px 32px rgba(16,24,40,.18);--font:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif}*{box-sizing:border-box}.card-head p,body,html{margin:0}body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased}h1,h2,h3{margin:0;font-weight:600;letter-spacing:-.01em}h2{font-size:15px}h3{font-size:16px}.muted{color:var(--muted)}.small{font-size:12.5px}button,input,select,textarea{font:inherit;color:inherit}[hidden]{display:none!important}.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px}.brand-lg{font-size:20px;margin-bottom:6px}.brand-mark{width:26px;height:26px;border-radius:7px;background:var(--primary)url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 21l6-6 4 4 8-8' stroke='white' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")center/100%no-repeat;flex:none}.topbar,.topbar-right{display:flex;align-items:center}.topbar{justify-content:space-between;padding:12px 24px;background:var(--surface);border-bottom:1px solid var(--border);gap:12px}.topbar-right{gap:10px;min-width:0}.source-pill{font-size:12px;padding:4px 10px;border-radius:999px;background:var(--warn-soft);color:#93370d;border:1px solid #fedf89;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}.source-pill.live{background:#ecfdf3;color:var(--pos);border-color:#abefc6}.tabs{display:flex;gap:4px;padding:0 24px;background:var(--surface);border-bottom:1px solid var(--border);overflow-x:auto}.tab{border:0;background:0 0;padding:12px;cursor:pointer;color:var(--text-2);font-weight:500;border-bottom:2px solid transparent;white-space:nowrap}.tab:hover{color:var(--text)}.tab.active{color:var(--primary);border-bottom-color:var(--primary)}.page{max-width:1440px;margin:0 auto;padding:20px 24px 60px}.page,.view{display:flex;flex-direction:column;gap:16px}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;min-width:0}.card-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:12px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border-strong);background:var(--surface);padding:8px 14px;border-radius:8px;cursor:pointer;font-weight:500;text-decoration:none;color:var(--text);white-space:nowrap;transition:background .12s,border-color .12s}.btn:hover,.grid tr.group-head td.sticky,.menu button:hover{background:var(--surface-2)}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-sm{padding:6px 11px;font-size:13px}.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-hover)}.btn-ghost{border-color:transparent;background:0 0}.btn-danger-ghost,.kpi.bad .kpi-value{color:var(--neg)}.btn-danger{background:var(--neg);border-color:var(--neg);color:#fff}.btn-block{width:100%}.icon-btn,.link-btn{border:0;background:0 0;cursor:pointer}.icon-btn{font-size:24px;line-height:1;color:var(--muted);padding:4px 8px;border-radius:6px}.icon-btn:hover{background:var(--surface-2);color:var(--text)}.link-btn{color:var(--primary);padding:0;font-weight:500}.field{display:flex;flex-direction:column;gap:5px;min-width:0}.field>span{font-size:12.5px;font-weight:500;color:var(--text-2)}.field input,.field select,.field textarea{border:1px solid var(--border-strong);border-radius:8px;padding:8px 10px;background:var(--surface);min-width:0;width:100%}.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid var(--primary-soft);border-color:var(--primary)}.field-inline{flex-direction:row;align-items:center;gap:8px}.field-inline select{min-width:200px;font-weight:600}.field-grow{flex:1 1 260px}.field .suffix-wrap{position:relative}.field .suffix-wrap input{padding-right:34px}.field .suffix-wrap em{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-style:normal;color:var(--muted)}.toolbar,.toolbar-group{display:flex;align-items:center;flex-wrap:wrap}.toolbar{justify-content:space-between;gap:12px;padding:12px 16px}.toolbar-group{gap:8px}.save-state{font-size:12.5px;color:var(--muted)}.save-state.dirty{color:#b54708;font-weight:500}.settings{display:flex;gap:14px;flex-wrap:wrap;align-items:flex-end}.settings .field{flex:0 1 160px}.settings .field-grow{flex:1 1 260px}.menu-wrap{position:relative}.menu{position:absolute;right:0;top:calc(100% + 6px);background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-lg);padding:6px;min-width:210px;z-index:30}.menu button{display:block;width:100%;text-align:left;border:0;background:0 0;padding:8px 10px;border-radius:6px;cursor:pointer}.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}.grid td,.grid th,.kpi{background:var(--surface)}.kpi{border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow)}.kpi-label{font-size:12.5px;color:var(--muted);font-weight:500}.kpi-value{font-size:22px;font-weight:700;margin-top:4px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}.kpi-sub{font-size:12px;color:var(--muted);margin-top:2px}.chart-box{position:relative;height:260px}.chart-box-sm{height:150px}.chart-sub{margin-top:18px;padding-top:14px;border-top:1px solid var(--border)}.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--text-2)}.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px;vertical-align:-1px}.legend i.line{height:3px;border-radius:2px;vertical-align:3px;width:14px}.legend i.dash{height:0;border-top:3px dashed;background:0 0!important;vertical-align:3px;width:14px}.grid-card{padding-bottom:8px}.grid-scroll{overflow:auto;max-height:72vh;border:1px solid var(--border);border-radius:8px}.grid{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-variant-numeric:tabular-nums;font-size:13px}.grid td,.grid th{padding:7px 10px;border-bottom:1px solid var(--border);text-align:right;white-space:nowrap}.grid thead th{position:sticky;top:0;z-index:3;background:var(--surface-2);font-weight:600;font-size:12px;color:var(--text-2)}.grid thead th .tag,.grid tr.group-head td{text-transform:uppercase;letter-spacing:.04em}.grid thead th .tag{display:block;font-size:10.5px;font-weight:500;color:var(--muted)}.grid .sticky{position:sticky;left:0;z-index:2;text-align:left;min-width:240px;max-width:280px;border-right:1px solid var(--border)}.grid thead .sticky{z-index:4}.grid td.hist,.grid th.hist{background:var(--hist-bg);color:var(--text-2)}.grid td.first-f,.grid th.first-f{border-left:2px solid var(--primary)}.grid td.total,.grid th.total{font-weight:600;border-left:1px solid var(--border);background:var(--surface-2)}.grid tr.group-head td{background:var(--surface-2);font-weight:600;text-align:left;font-size:12px;color:var(--text-2);padding-top:10px}.grid tr.subtotal td{font-weight:600;background:#fcfcfd}.grid tr.key td{font-weight:700}.grid tr.key td,.grid tr.key td.sticky{background:var(--primary-soft)}.grid tr.closing td{font-weight:700;border-top:2px solid var(--text)}.grid .neg{color:var(--neg)}.grid td.cell-neg-bg{background:var(--neg-soft)}.line-name{display:flex;flex-direction:column;gap:2px;cursor:pointer}.line-name .nm{overflow:hidden;text-overflow:ellipsis}.add-line,.chip,.line-name:hover .nm{color:var(--primary)}.add-line,.chip,.line-name .nm{font-weight:500}.chip{display:inline-flex;align-self:flex-start;font-size:11px;padding:1px 7px;border-radius:999px;background:var(--primary-soft)}.chip.manual{background:#fef6ee;color:#b93815}.chip .ov{margin-left:4px;color:var(--override)}.grid td.editable{cursor:text}.grid td.editable:hover{box-shadow:inset 0 0 0 1px var(--primary)}.grid td.overridden{position:relative;background:#fffcf5}.grid td.overridden::before{content:"";position:absolute;top:4px;left:4px;width:6px;height:6px;border-radius:50%;background:var(--override)}.grid td input.cell-input{width:100%;min-width:80px;border:1px solid var(--primary);border-radius:4px;padding:3px 5px;text-align:right;font:inherit;outline:0;background:#fff}.add-line{border:0;background:0 0;cursor:pointer;font-size:12px;text-transform:none;letter-spacing:0;margin-left:10px;padding:0}.add-line:hover{text-decoration:underline}.empty-hint td{color:var(--muted);font-style:italic;text-align:left}.compare-picks{display:flex;flex-wrap:wrap;gap:10px}.pick,.xero-row{display:flex;align-items:center}.pick{gap:8px;border:1px solid var(--border-strong);border-radius:8px;padding:8px 12px;cursor:pointer;user-select:none}.pick input{accent-color:var(--primary)}.pick .sw{width:10px;height:10px;border-radius:2px}.compare-table td.sticky{font-weight:500}.xero-row{gap:14px;flex-wrap:wrap;margin-bottom:10px}.xero-row>div:nth-child(2){flex:1 1 240px}.xero-row p{margin:2px 0 0}.xero-logo{width:44px;height:44px;border-radius:50%;background:#13b5ea;color:#fff;display:grid;place-items:center;font-weight:700;font-size:20px}.drawer-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.25);z-index:40}.drawer{position:fixed;top:0;right:0;height:100%;width:min(420px,100vw);background:var(--surface);box-shadow:var(--shadow-lg);z-index:41;transform:translateX(105%);transition:transform .2s ease;display:flex;flex-direction:column}.drawer.open{transform:none}.drawer-head{display:flex;justify-content:space-between;align-items:flex-start;padding:18px 20px;border-bottom:1px solid var(--border);gap:10px}.drawer-head h2{font-size:18px}.drawer-body,.method-list{display:flex;flex-direction:column}.drawer-body{padding:18px 20px;overflow-y:auto;gap:16px}.method-list{gap:6px}.method-opt,.params{display:flex;border:1px solid var(--border);border-radius:8px}.method-opt{gap:10px;align-items:flex-start;padding:9px 11px;cursor:pointer}.method-opt:hover{border-color:var(--border-strong)}.method-opt.sel{border-color:var(--primary);background:var(--primary-soft)}.method-opt input{margin-top:3px;accent-color:var(--primary)}.method-opt b{font-weight:600;display:block;font-size:13.5px}.method-opt small,.stat span{color:var(--muted);font-size:12px}.params{flex-direction:column;gap:12px;background:var(--surface-2);padding:12px}.params .row{display:flex;gap:10px}.params .row .field{flex:1}.stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stat{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:8px 10px}.preview table,.stat b{font-variant-numeric:tabular-nums}.stat b{display:block;font-size:14px}.stat span{font-size:11.5px}.preview{font-size:12.5px;color:var(--text-2)}.preview table{width:100%;border-collapse:collapse}.preview td{padding:3px 0;border-bottom:1px dashed var(--border)}.preview td:last-child{text-align:right}.section-label{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.drawer-foot{display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:14px}.modal-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.4);z-index:60;display:grid;place-items:center;padding:16px}.modal{background:var(--surface);border-radius:12px;box-shadow:var(--shadow-lg);padding:22px;width:min(440px,100%);display:flex;flex-direction:column;gap:14px}.modal p{margin:0;color:var(--text-2)}.modal-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--text);color:#fff;padding:10px 16px;border-radius:8px;box-shadow:var(--shadow-lg);z-index:70;font-size:13.5px;max-width:calc(100vw - 32px)}.toast.err{background:var(--neg)}.form-error{color:var(--neg);font-size:13px}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:16px;background:radial-gradient(1200px 600px at 20% -10%,#dbe7ff 0%,transparent 60%),var(--bg)}.login-card{width:min(380px,100%);background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-lg);padding:28px;display:flex;flex-direction:column;gap:16px}.login-card p{margin:0}@media (max-width:720px){.tabs,.topbar{padding-left:16px;padding-right:16px}.page{padding:16px 16px 48px}.field-inline{flex-direction:column;align-items:stretch;width:100%}.field-inline select{min-width:0}.toolbar-group{width:100%}.settings .field{flex:1 1 calc(50% - 7px)}.grid .sticky{min-width:170px;max-width:190px}.chart-box{height:220px}.chart-box-sm{height:130px}.kpi-value{font-size:17px}.kpis{grid-template-columns:1fr 1fr;gap:10px}.kpi{padding:12px}.brand{font-size:15px}}@media print{body{background:#fff;font-size:10px}#view-compare,#view-data,.drawer,.drawer-backdrop,.grid-card .card-head p,.modal-backdrop,.settings,.tabs,.toast,.toolbar,.topbar-right{display:none!important}.page{padding:0;max-width:none}.card,.kpi{box-shadow:none;break-inside:avoid}.grid-scroll{max-height:none;overflow:visible;border:0}.grid{font-size:8.5px;width:100%}.grid td,.grid th{padding:3px 4px}.grid .sticky{min-width:0}.grid .sticky,.grid thead th{position:static}.chart-box{height:200px}.chart-box-sm{height:110px}.print-title{display:block!important}}.print-title{display:none;font-size:16px;font-weight:700;margin-bottom:6px}