:root{--bg:#f4f5f7;--surface:#fff;--border:#e3e6ea;--border-soft:#eef0f3;--accent:#2563eb;--accent-hover:#1d4ed8;--accent-light:#eff6ff;--text:#1f2937;--muted:#6b7280;--muted-light:#9ca3af;--success:#16a34a;--error:#dc2626;--error-bg:#fef2f2;--radius:8px;--radius-sm:4px;--shadow:0 1px 3px #0000000f, 0 1px 2px #0000000a}*,:before,:after{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;min-height:100vh;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;line-height:1.5}.app{max-width:1280px;margin:0 auto;padding:0 1rem 2rem}.header{background:var(--surface);border-bottom:1px solid var(--border);z-index:50;align-items:center;gap:1.5rem;margin-bottom:1.5rem;margin-left:-1rem;margin-right:-1rem;padding:.85rem 1.5rem;display:flex;position:sticky;top:0}.header h1{color:var(--text);letter-spacing:-.01em;flex:1;font-size:1.05rem;font-weight:600}.client-selector{color:var(--muted);align-items:center;gap:.5rem;font-size:.82rem;display:flex}.client-selector select{border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;outline:none;padding:.3rem .6rem;font-size:.82rem;transition:border-color .15s}.client-selector select:focus{border-color:var(--accent)}.token-status{color:var(--muted-light);align-items:center;gap:.35rem;font-size:.72rem;display:flex}.token-status:before{content:"";background:var(--muted-light);border-radius:50%;flex-shrink:0;width:6px;height:6px;display:inline-block}.token-status.ok{color:var(--success)}.token-status.ok:before{background:var(--success)}.token-status.err{color:var(--error)}.token-status.err:before{background:var(--error)}.tabs{border-bottom:1px solid var(--border);gap:.25rem;margin-bottom:1.25rem;padding-bottom:0;display:flex}.tab-btn{color:var(--muted);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0;margin-bottom:-1px;padding:.55rem 1.1rem;font-size:.875rem;font-weight:500;transition:color .15s,border-color .15s}.tab-btn:hover:not(:disabled){color:var(--text)}.tab-btn.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.tab-factory{color:var(--text);border:1px solid var(--border);border-radius:var(--radius);align-items:center;gap:.35rem;margin-bottom:0;margin-left:auto;text-decoration:none;display:inline-flex}.tab-factory:hover{color:var(--accent);border-color:var(--accent)}.card{background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);margin-bottom:1rem;padding:1.25rem}.card h2{color:var(--text);margin-bottom:1rem;font-size:1rem;font-weight:600}.report-card{padding:0;overflow:hidden}.report-card-header{align-items:baseline;gap:.75rem;padding:1.1rem 1.25rem 0;display:flex}.report-title{color:var(--text);font-size:1rem;font-weight:600}.report-row-count{color:var(--muted);font-variant-numeric:tabular-nums;font-size:.78rem}.sub-tabs{gap:.25rem;margin-bottom:1rem;display:flex}.sub-tab-btn{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--muted);cursor:pointer;align-items:center;gap:.4rem;padding:.4rem 1rem;font-size:.83rem;font-weight:500;transition:background .15s,color .15s,border-color .15s;display:flex}.sub-tab-btn:hover:not(:disabled):not(.sub-tab-btn--disabled){background:var(--accent-light);border-color:var(--accent);color:var(--accent)}.sub-tab-btn--active{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}.sub-tab-btn--disabled{cursor:default;color:var(--muted-light);background:var(--bg);border-color:var(--border-soft)}.sub-tab-soon{background:var(--border);color:var(--muted-light);text-transform:lowercase;border-radius:3px;padding:1px 5px;font-size:.65rem;font-weight:400}.filter-bar{border-bottom:1px solid var(--border-soft);background:#fafbfc;padding:1rem 1.25rem}.filter-grid{flex-wrap:wrap;align-items:flex-end;gap:.75rem;margin-bottom:.75rem;display:flex}.filter-cell{flex-direction:column;gap:.3rem;min-width:150px;display:flex}.filter-label{text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-size:.7rem;font-weight:600}.date-range{flex-wrap:wrap;gap:.4rem;display:flex}.date-field{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:.3rem;height:32px;padding:0 .4rem;transition:border-color .15s;display:flex}.date-field:focus-within{border-color:var(--accent)}.date-field-prefix{color:var(--muted);white-space:nowrap;font-size:.7rem;font-weight:500}.date-input{color:var(--text);background:0 0;border:none;outline:none;min-width:0;padding:0;font-size:.8rem}.filter-actions{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.filter-deferred{color:var(--muted-light);cursor:default;margin-left:.5rem;font-size:.72rem}.btn{border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;border:1px solid #0000;justify-content:center;align-items:center;padding:.4rem 1rem;font-size:.83rem;font-weight:500;transition:background .15s,border-color .15s,opacity .15s;display:inline-flex}.btn:disabled{opacity:.4;cursor:not-allowed}.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}.btn-primary:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover)}.btn-secondary{background:var(--surface);color:var(--text);border-color:var(--border)}.btn-secondary:hover:not(:disabled){background:var(--bg);border-color:#c9cdd4}.active-chips{border-bottom:1px solid var(--border-soft);flex-wrap:wrap;align-items:center;gap:.4rem;padding:.6rem 1.25rem;display:flex}.active-chip{background:var(--accent-light);color:var(--accent);border:1px solid #bfdbfe;border-radius:12px;align-items:center;padding:2px 8px;font-size:.72rem;font-weight:500;display:inline-flex}.chips-clear-btn{color:var(--muted);cursor:pointer;background:0 0;border:none;margin-left:.25rem;padding:0;font-size:.72rem;text-decoration:underline}.chips-clear-btn:hover{color:var(--error)}.ms-root{flex-direction:column;gap:.3rem;display:flex;position:relative}.ms-label{text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-size:.7rem;font-weight:600}.ms-trigger{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);width:100%;min-width:150px;height:32px;color:var(--muted);cursor:pointer;text-align:left;justify-content:space-between;align-items:center;gap:.4rem;padding:0 .6rem;font-size:.82rem;transition:border-color .15s,color .15s;display:flex}.ms-trigger:hover{border-color:#c9cdd4}.ms-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.ms-trigger--active{color:var(--text);border-color:var(--accent);background:var(--accent-light)}.ms-trigger-text{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.ms-chevron{color:var(--muted-light);flex-shrink:0;transition:transform .15s}.ms-chevron--open{transform:rotate(180deg)}.ms-popover{z-index:200;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:max-content;min-width:200px;max-width:320px;position:absolute;top:calc(100% + 4px);left:0;box-shadow:0 4px 16px #0000001a,0 1px 4px #0000000f}.ms-search-wrap{border-bottom:1px solid var(--border-soft);padding:.5rem .6rem .3rem}.ms-search{border:1px solid var(--border);border-radius:var(--radius-sm);width:100%;height:28px;color:var(--text);background:var(--surface);outline:none;padding:0 .5rem;font-size:.8rem;transition:border-color .15s}.ms-search:focus{border-color:var(--accent)}.ms-quick-actions{border-bottom:1px solid var(--border-soft);gap:.25rem;padding:.4rem .6rem;display:flex}.ms-quick-btn{border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--muted);cursor:pointer;background:0 0;padding:2px 8px;font-size:.72rem;transition:background .12s,color .12s,border-color .12s}.ms-quick-btn:hover{background:var(--accent-light);color:var(--accent);border-color:var(--accent)}.ms-list{overscroll-behavior:contain;max-height:240px;padding:.3rem 0;overflow-y:auto}.ms-list::-webkit-scrollbar{width:5px}.ms-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.ms-empty{color:var(--muted-light);text-align:center;padding:.75rem;font-size:.8rem}.ms-item{cursor:pointer;color:var(--text);align-items:center;gap:.5rem;padding:.3rem .75rem;font-size:.82rem;transition:background .1s;display:flex}.ms-item:hover{background:#f8f9fa}.ms-item--checked{background:var(--accent-light)}.ms-item--checked:hover{background:#dbeafe}.ms-checkbox{width:14px;height:14px;accent-color:var(--accent);cursor:pointer;flex-shrink:0}.ms-item-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.col-selector-root{display:inline-block;position:relative}.col-selector-popover{z-index:200;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);min-width:200px;position:absolute;top:calc(100% + 4px);right:0;box-shadow:0 4px 16px #0000001a,0 1px 4px #0000000f}.col-selector-actions{border-bottom:1px solid var(--border-soft);gap:.25rem;padding:.4rem .6rem;display:flex}.col-selector-list{max-height:280px;padding:.3rem 0;overflow-y:auto}.col-selector-list::-webkit-scrollbar{width:5px}.col-selector-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.table-container{max-height:60vh;overflow:auto}.table-container::-webkit-scrollbar{width:6px;height:6px}.table-container::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.data-table{border-collapse:collapse;table-layout:auto;width:100%;font-size:.8rem}.data-table thead{z-index:10;position:sticky;top:0}.data-table th{text-align:left;text-transform:capitalize;color:var(--muted);border-bottom:1px solid var(--border);white-space:nowrap;-webkit-user-select:none;user-select:none;background:#f8f9fb;padding:.55rem .75rem;font-size:.72rem;font-weight:600}.data-table th.col-numeric{text-align:right}.data-table td{border-bottom:1px solid var(--border-soft);white-space:nowrap;color:var(--text);vertical-align:middle;padding:.45rem .75rem}.data-table .cell-numeric{text-align:right;font-variant-numeric:tabular-nums}.data-table .cell-null{color:var(--muted-light)}.data-table .row-even td{background:var(--surface)}.data-table .row-odd td{background:#fafbfc}.data-table tr:hover td{background:#f0f5ff!important}.table-empty{text-align:center;color:var(--muted-light);padding:2.5rem 1rem;font-size:.875rem}.pagination{border-top:1px solid var(--border-soft);justify-content:center;align-items:center;gap:.75rem;padding:.85rem 1.25rem;display:flex}.pagination-btn{min-width:90px}.pagination-info{color:var(--muted);font-variant-numeric:tabular-nums;text-align:center;min-width:120px;font-size:.82rem}.filters{flex-wrap:wrap;align-items:flex-end;gap:.75rem;margin-bottom:1rem;display:flex}.filter-group{flex-direction:column;gap:.25rem;display:flex}.filter-group label{text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-size:.72rem;font-weight:600}.filter-group select,.filter-group input{border:1px solid var(--border);border-radius:var(--radius-sm);min-width:120px;color:var(--text);background:var(--surface);padding:.3rem .6rem;font-size:.82rem}.charts-grid{grid-template-columns:1fr 1fr;gap:1rem;display:grid}@media (width<=768px){.charts-grid{grid-template-columns:1fr}}.chart-card{background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:1.25rem}.chart-card h3{color:var(--text);margin-bottom:.85rem;font-size:.9rem;font-weight:600}.chart-card.wide{grid-column:1/-1}.kpi-row{grid-template-columns:repeat(4,1fr);gap:1rem;margin-bottom:.5rem;display:grid}@media (width<=768px){.kpi-row{grid-template-columns:repeat(2,1fr)}}.kpi-card{background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);flex-direction:column;gap:.35rem;padding:1.1rem 1.25rem;display:flex}.kpi-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:.72rem;font-weight:600}.kpi-value{color:var(--text);font-variant-numeric:tabular-nums;font-size:1.65rem;font-weight:700}.loading{color:var(--muted);text-align:center;padding:1.5rem;font-size:.875rem}.error-msg{color:var(--error);background:var(--error-bg);border-radius:var(--radius-sm);border:1px solid #fecaca;margin:.5rem 1.25rem;padding:.6rem .75rem;font-size:.83rem}.empty{color:var(--muted-light);padding:1rem 0;font-size:.875rem}.stub-msg{color:var(--muted);text-align:center;border:2px dashed var(--border);border-radius:var(--radius);padding:2rem;font-size:.9rem;font-style:italic}
