:root{--bg: #f5f7fa;--surface: #ffffff;--text: #1f2933;--muted: #6b7785;--border: #e1e6ec;--accent: #1f2b5c;--won: #0f9d58;--lost: #c0392b;--st-ganado: #146c2e;--st-ganado-bg: #d8f3df;--st-proceso: #7a5600;--st-proceso-bg: #fdf0b8;--st-perdido: #a32020;--st-perdido-bg: #fbdcdc;--fill-ganado: #0ca30c;--fill-proceso: #fab219;--fill-perdido: #d03b3b;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--text);background:var(--bg)}@media (prefers-color-scheme: dark){:root{--bg: #12161b;--surface: #1b2128;--text: #e6e9ed;--muted: #93a0ad;--border: #2c343d;--st-ganado: #7ee2a0;--st-ganado-bg: #173d24;--st-proceso: #f6d264;--st-proceso-bg: #4a3c0c;--st-perdido: #ff9c9c;--st-perdido-bg: #4d1c1c}}*{box-sizing:border-box}body{margin:0;background:var(--bg)}.app{max-width:1280px;margin:0 auto;padding:24px 16px 48px}.muted{color:var(--muted);font-size:.85rem}h1{margin:0 0 4px;font-size:1.6rem}.header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:20px}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.user{color:var(--muted);font-size:.85rem;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button,input,select{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 12px}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:#fff}.error{background:#fdecea;color:#8a1c13;border:1px solid #f5c2bd;padding:12px 16px;border-radius:8px;margin-bottom:16px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-bottom:20px}.card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}.card strong{font-size:1.35rem;font-variant-numeric:tabular-nums}.filters{display:grid;gap:12px;align-items:end;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 16px}.field{display:flex;flex-direction:column;gap:4px;min-width:0}.field>span{font-size:.8rem;font-weight:600;color:var(--muted)}.field input,.field select{width:100%;min-width:0}.field.end{justify-content:flex-end}.pair{display:flex;gap:6px}.hint{margin:6px 2px 16px}.table-wrap{position:relative;min-height:160px;overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:10px}table{width:100%;border-collapse:collapse;font-size:.92rem}th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap}table.deals{table-layout:fixed}table.deals th,table.deals td{overflow:hidden;text-overflow:ellipsis}table.deals th{position:sticky}.th-label{display:block;overflow:hidden;text-overflow:ellipsis;padding-right:6px}.col-resizer{position:absolute;top:0;right:0;bottom:0;width:9px;cursor:col-resize;touch-action:none;z-index:1}.col-resizer:after{content:"";position:absolute;top:25%;bottom:25%;right:4px;width:1px;background:var(--border)}.col-resizer:hover:after,body.col-resizing .col-resizer:after{width:3px;right:3px;background:var(--accent)}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.card-label{display:flex;align-items:center;gap:6px}.cards.is-loading{opacity:.4;transition:opacity .15s}.table-wrap.is-loading table{opacity:.35;pointer-events:none}.loader{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:10px;padding-top:72px;color:var(--muted);font-weight:600}.spinner{width:32px;height:32px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--accent);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:2.4s}}th{cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;color:var(--muted);position:sticky;top:0;background:var(--surface)}th .arrow{margin-left:4px;font-size:.7rem}.num{text-align:right;font-variant-numeric:tabular-nums}tbody tr:hover{background:color-mix(in srgb,var(--accent) 6%,transparent)}.empty{text-align:center;color:var(--muted);padding:32px}.badge{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font-size:.8rem;font-weight:600}.badge:before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}.badge.ganado{color:var(--st-ganado);background:var(--st-ganado-bg)}.badge.proceso{color:var(--st-proceso);background:var(--st-proceso-bg)}.badge.perdido{color:var(--st-perdido);background:var(--st-perdido-bg)}.pager{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:16px}.charts{margin-top:32px;transition:opacity .15s}.charts.is-loading{opacity:.4}.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.section-head h2{margin:0;font-size:1.2rem}.legend{display:flex;gap:16px;list-style:none;margin:0;padding:0;font-size:.85rem;color:var(--muted)}.legend li{display:flex;align-items:center;gap:6px}.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;flex:none}.swatch.ganado{background:var(--fill-ganado)}.swatch.proceso{background:var(--fill-proceso)}.swatch.perdido{background:var(--fill-perdido)}.chart-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:12px}.chart-card header{display:flex;flex-direction:column;gap:2px}.chart-card h3{margin:0;font-size:1rem}.pie{width:160px;height:160px;align-self:center;overflow:visible}.slice{stroke:var(--surface);stroke-width:2px;stroke-linejoin:round;transition:opacity .15s;cursor:default}.slice.ganado{fill:var(--fill-ganado)}.slice.proceso{fill:var(--fill-proceso)}.slice.perdido{fill:var(--fill-perdido)}.slice.dim{opacity:.35}.pie-table{width:100%;font-size:.88rem}.pie-table th,.pie-table td{padding:4px 2px;border-bottom:1px solid var(--border);white-space:nowrap}.pie-table tr:last-child th,.pie-table tr:last-child td{border-bottom:0}.pie-table th{display:flex;align-items:center;gap:8px;font-weight:500;color:var(--text);cursor:default;position:static;background:none}.pie-table td.pct{font-weight:600;width:64px}.pie-table tr.active{background:color-mix(in srgb,var(--muted) 10%,transparent)}.config{background:var(--surface);border:1px solid var(--border);border-radius:10px;margin-bottom:12px}.config summary{display:flex;align-items:center;gap:8px;padding:10px 16px;cursor:pointer;list-style:none;font-weight:600;font-size:.9rem;-webkit-user-select:none;user-select:none}.config summary::-webkit-details-marker{display:none}.config .chevron{width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);transition:transform .15s;margin-right:2px}.config[open] .chevron{transform:rotate(45deg)}.config .count{background:color-mix(in srgb,var(--accent) 15%,transparent);color:var(--text);border-radius:999px;padding:0 8px;font-size:.8rem}.save-state{margin-left:auto;font-weight:500;font-size:.8rem;color:var(--muted)}.save-state.saved{color:var(--st-ganado)}.save-state.error{color:var(--st-perdido)}.config-body{padding:0 16px 14px;display:flex;flex-direction:column;gap:10px}.config-body p{margin:0}.warn{color:var(--st-perdido);font-size:.85rem}.ms{position:relative}.ms-control{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:40px;padding:5px 8px;border:1px solid var(--border);border-radius:8px;background:var(--surface);cursor:text}.ms.open .ms-control{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent)}.ms-control input{flex:1 1 120px;border:0;padding:4px;outline:none;background:transparent;min-width:80px}.ms-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 10px;border-radius:999px;background:color-mix(in srgb,var(--accent) 14%,transparent);font-size:.85rem;font-weight:500}.ms-chip button{border:0;background:transparent;padding:0 6px;font-size:1rem;line-height:1;color:var(--muted);border-radius:999px}.ms-chip button:hover{color:var(--text);background:color-mix(in srgb,var(--muted) 20%,transparent)}.ms-menu{position:absolute;z-index:10;left:0;right:0;top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:var(--surface);border:1px solid var(--border);border-radius:8px;max-height:280px;overflow-y:auto;box-shadow:0 8px 24px #0000001f}.ms-menu li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:6px;cursor:pointer}.ms-menu li.active{background:color-mix(in srgb,var(--accent) 10%,transparent)}.ms-menu li.selected .ms-label{font-weight:600}.ms-check{width:16px;color:var(--accent);font-weight:700}.ms-hint{margin-left:auto;color:var(--muted);font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ms-empty{color:var(--muted);cursor:default!important}.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px}.login-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:28px 24px;display:flex;flex-direction:column;gap:14px}.login-card h1,.login-card p,.login-card .error{margin:0}.login-buttons{display:flex;flex-direction:column;gap:10px;margin-top:4px}.login-btn{display:flex;align-items:center;justify-content:center;gap:10px;padding:11px 14px;border:1px solid var(--border);border-radius:8px;color:var(--text);text-decoration:none;font-weight:600;background:var(--surface)}.login-btn:hover{background:color-mix(in srgb,var(--muted) 10%,transparent)}
