*{box-sizing:border-box}:root{--bg:#f4f6f8;--card:#fff;--ink:#111827;--muted:#6b7280;--line:#dfe4ea;--orange:#ff6b0b;--red:#b42318;--green:#147d3f;--blue:#1d4ed8}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.top{background:#101827;color:#fff;padding:25px max(24px,calc((100vw - 1440px)/2));display:flex;justify-content:space-between;gap:20px;align-items:center}.brand{font-weight:800;letter-spacing:.18em;color:#fb923c;font-size:12px}.top h1{margin:3px 0;font-size:29px}.top p{margin:0;color:#cbd5e1}.top-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.pill,.badge{border-radius:999px;padding:8px 11px;font-size:12px;background:#253045;color:#dbe3ef}.pill.ok{background:#064e3b;color:#d1fae5}.pill.bad{background:#7f1d1d;color:#fee2e2}nav{display:flex;gap:4px;overflow:auto;background:#fff;border-bottom:1px solid var(--line);padding:9px max(16px,calc((100vw - 1440px)/2));position:sticky;top:0;z-index:10}nav button{white-space:nowrap;border:0;background:none;padding:10px 13px;border-radius:8px;font-weight:700;color:#4b5563;cursor:pointer}nav button.active{background:#fff1e8;color:#d94f00}nav b{background:#ef4444;color:#fff;border-radius:999px;padding:2px 6px;font-size:10px}main{max-width:1440px;margin:22px auto 60px;padding:0 20px}.view{display:none}.view.active{display:block}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:20px;margin-bottom:18px;box-shadow:0 8px 24px rgba(15,23,42,.045)}.head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.head h2,.card h2{margin:0;font-size:19px}.head i{font-style:normal;background:#fff1e8;color:#e85d04;border-radius:50%;width:28px;height:28px;display:inline-grid;place-items:center;margin-right:7px}.btn,.primary{border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 12px;font-weight:700;cursor:pointer}.primary{background:var(--orange);color:white;border-color:var(--orange)}.danger{color:var(--red)}.full{width:100%;height:49px}.drop{border:2px dashed #cad5e3;min-height:190px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-direction:column;cursor:pointer;text-align:center}.drop input,.filebtn input{display:none}.drop span{color:var(--muted);font-size:13px;margin-top:5px}.fileitem{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line);padding:9px 11px;border-radius:9px;margin:10px 0}.form2{display:grid;grid-template-columns:1fr 1fr;gap:13px}label{font-size:12px;font-weight:750;color:#374151;display:block}input,select,textarea{width:100%;border:1px solid #cfd6df;border-radius:8px;padding:9px 10px;margin-top:5px;font:inherit;color:#111827;background:#fff}textarea{min-height:70px}.inline{display:flex;gap:6px}.inline .btn{margin-top:5px}.tablewrap{overflow:auto;border:1px solid var(--line);border-radius:11px}table{width:100%;border-collapse:collapse;min-width:980px}th,td{padding:8px;border-bottom:1px solid var(--line);text-align:left;font-size:12px}th{background:#f8fafc;color:#4b5563}td input,td select{min-width:90px;margin:0;padding:7px}.num{text-align:right}.x{border:0;background:#eef2f6;border-radius:7px;width:29px;height:29px;font-size:18px}.mapstatus{font-size:11px;padding:5px 7px;border-radius:999px;white-space:nowrap;background:#f3f4f6}.mapstatus.auto{background:#dcfce7;color:#166534}.mapstatus.manual{background:#dbeafe;color:#1e40af}.mapstatus.none{background:#fee2e2;color:#991b1b}.totals{display:flex;justify-content:flex-end;gap:25px;padding-top:15px}.totals span{color:var(--muted);font-size:12px}.totals b{display:block;color:#111827;font-size:18px}.actionbar{display:flex;justify-content:space-between;align-items:center}.actionbar h2{margin-bottom:5px}.actionbar p{margin:0;color:var(--muted)}.filters{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:8px;margin-bottom:12px}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:18px}.kpis div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px}.kpis span{font-size:12px;color:var(--muted);display:block}.kpis b{font-size:26px;margin-top:5px;display:block}.barrow{display:grid;grid-template-columns:120px 1fr 110px;gap:9px;align-items:center;margin:10px 0;font-size:12px}.bar{height:10px;background:#eef2f6;border-radius:99px;overflow:hidden}.bar i{height:100%;display:block;background:var(--orange)}.exception{border:1px solid #fecaca;background:#fff7f7;padding:12px;border-radius:10px;margin:8px 0}.exception strong{display:block}.exception span{font-size:12px;color:#7f1d1d}.stack{display:grid;gap:9px}.msg{padding:11px;margin-top:10px;border-radius:9px;background:#fee2e2;color:#991b1b}.msg.ok{background:#dcfce7;color:#166534}.hidden{display:none}.badge{background:#f3f4f6;color:#4b5563}@media(max-width:900px){.grid2{grid-template-columns:1fr}.form2{grid-template-columns:1fr}.filters{grid-template-columns:1fr}.kpis{grid-template-columns:1fr 1fr}.actionbar{display:block}.actionbar>div:last-child{margin-top:12px}.top{display:block}.top-actions{justify-content:flex-start;margin-top:12px}}
.head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.import-note{font-size:13px;color:var(--muted);background:#f8fafc;border:1px solid var(--line);padding:11px 12px;border-radius:9px;margin-bottom:14px}
.import-panel{border:1px solid #fed7aa;background:#fffaf5;border-radius:12px;padding:15px;margin-bottom:16px}
.import-panel h3{margin:0;font-size:17px}
.import-summary{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.import-summary span{background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 10px;font-size:12px}
.import-preview{max-height:420px;margin-top:12px}
.import-preview tr.invalid{background:#fff1f2}
.import-preview td.error{color:#b42318;font-weight:700}
.import-actions{display:flex;justify-content:flex-end;margin-top:12px}
@media(max-width:900px){.head-actions{justify-content:flex-start}.head{align-items:flex-start;flex-direction:column}}

.subtle{color:var(--muted);font-size:13px;margin:5px 0 0}
.report-tabs{display:flex;gap:7px;margin:16px 0 12px;border-bottom:1px solid var(--line);padding-bottom:8px}
.report-tabs button{border:0;background:#f3f4f6;border-radius:8px;padding:9px 12px;font-weight:700;cursor:pointer;color:#4b5563}
.report-tabs button.active{background:#fff1e8;color:#d94f00}
.report-panel{display:none}
.report-panel.active{display:block}
#reportMonth{width:auto;min-width:150px;margin:0}
.delta-up{color:#b42318;font-weight:700}
.delta-down{color:#147d3f;font-weight:700}
.delta-flat{color:#6b7280}

.import-result{border-radius:10px;padding:13px 14px;margin-bottom:14px;font-size:14px}
.import-result.success{background:#dcfce7;border:1px solid #86efac;color:#166534}
.import-result.error{background:#fee2e2;border:1px solid #fca5a5;color:#991b1b}
.import-result strong{display:block;font-size:15px;margin-bottom:3px}
.product-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0}
.product-toolbar input{max-width:420px;margin:0}
.product-new-row{animation:productFlash 2.4s ease}
@keyframes productFlash{0%,45%{background:#dcfce7}100%{background:transparent}}
@media(max-width:700px){.product-toolbar{align-items:stretch;flex-direction:column}.product-toolbar input{max-width:none}}

.registry-hint{font-size:13px;color:var(--muted);background:#f8fafc;border:1px solid var(--line);padding:10px 12px;border-radius:9px;margin-bottom:12px}
.registry-actions{display:flex;gap:6px;white-space:nowrap}
.registry-actions button{padding:6px 8px;font-size:11px}
.registry-check{width:16px;height:16px;margin:0}
.editing-banner{display:flex;justify-content:space-between;align-items:center;gap:15px;background:#fff7ed;border:1px solid #fdba74;color:#9a3412;border-radius:12px;padding:12px 15px;margin-bottom:16px}
.editing-banner strong{display:block}
.editing-banner span{font-size:12px}
.suggestion-list{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px;max-width:320px}
.suggestion-chip{border:1px solid #fed7aa;background:#fff7ed;color:#9a3412;border-radius:999px;padding:4px 7px;font-size:10px;cursor:pointer}
.suggestion-chip:hover{background:#ffedd5}
.suggestion-hint{font-size:10px;color:#6b7280;margin-top:4px;max-width:280px}
.match-reason{font-size:10px;color:#6b7280}
@media(max-width:900px){.editing-banner{align-items:flex-start;flex-direction:column}}

#rows .raw{min-width:360px;white-space:normal}
#rows .matched{min-width:360px}
#rows td:nth-child(2){min-width:390px}
#rows td:nth-child(3){min-width:390px}
.report-controls select{min-width:220px;margin:0}
.restore-options{padding:10px 0}
.restore-options select{margin-top:6px}
@media(max-width:900px){
  #rows .raw,#rows .matched{min-width:300px}
  .report-controls{width:100%}
  .report-controls input,.report-controls select,.report-controls button{width:100%}
}
