*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background-color:var(--tg-theme-bg-color, #ffffff);color:var(--tg-theme-text-color, #000000);padding:16px 16px 80px}.header{text-align:center;padding:20px 0;border-bottom:1px solid var(--tg-theme-hint-color, #ccc);margin-bottom:20px}.header h1{font-size:24px;font-weight:600;color:var(--tg-theme-text-color, #000)}.tab-container{display:flex;gap:8px;margin-bottom:12px;border-bottom:1px solid var(--tg-theme-hint-color, #ccc)}.tab{flex:1;padding:12px 8px;text-align:center;background:transparent;border:none;border-bottom:2px solid transparent;cursor:pointer;font-size:14px;color:var(--tg-theme-hint-color, #999);transition:all .3s}.tab.active{color:var(--tg-theme-button-color, #3390ec);border-bottom-color:var(--tg-theme-button-color, #3390ec)}.submenu-container{display:flex;gap:4px;margin-bottom:16px;padding:8px;background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:8px;overflow-x:auto}.submenu-tab{padding:8px 16px;text-align:center;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:13px;color:var(--tg-theme-text-color, #000);transition:all .3s;white-space:nowrap}.submenu-tab.active{background:var(--tg-theme-button-color, #3390ec);color:var(--tg-theme-button-text-color, #ffffff)}.tab-content{display:none}.tab-content.active{display:block}.card{background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:12px;padding:16px;margin-bottom:12px}.card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.card-title{font-size:16px;font-weight:600}.badge{padding:4px 8px;border-radius:6px;font-size:12px;font-weight:500}.badge.long{background:#22c55e33;color:#16a34a}.badge.short{background:#ef444433;color:#dc2626}.badge.open{background:#3b82f633;color:#2563eb}.card-info{display:flex;flex-direction:column;gap:8px}.info-row{display:flex;justify-content:space-between;font-size:14px}.info-label{color:var(--tg-theme-hint-color, #999)}.info-value{font-weight:500}.btn{width:100%;padding:14px;border-radius:8px;border:none;font-size:16px;font-weight:500;cursor:pointer;transition:all .3s;margin-top:8px}.btn-primary{background:var(--tg-theme-button-color, #3390ec);color:var(--tg-theme-button-text-color, #ffffff)}.btn-danger{background:#dc2626;color:#fff}.btn-secondary{background:var(--tg-theme-secondary-bg-color, #f4f4f5);color:var(--tg-theme-text-color, #000)}.form-group{margin-bottom:16px}.form-label{display:block;margin-bottom:8px;font-size:14px;font-weight:500;color:var(--tg-theme-text-color, #000)}.form-input,.form-select{width:100%;padding:12px;border-radius:8px;border:1px solid var(--tg-theme-hint-color, #ccc);font-size:16px;background:var(--tg-theme-bg-color, #ffffff);color:var(--tg-theme-text-color, #000)}.loading{text-align:center;padding:40px;color:var(--tg-theme-hint-color, #999)}.empty-state{text-align:center;padding:40px 20px;color:var(--tg-theme-hint-color, #999)}.empty-state-icon{font-size:48px;margin-bottom:16px}.stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:20px}.stat-card{background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:12px;padding:16px;text-align:center}.stat-value{font-size:24px;font-weight:600;margin-bottom:4px}.stat-label{font-size:12px;color:var(--tg-theme-hint-color, #999)}#auth-error{display:none;position:fixed;inset:0;background:var(--tg-theme-bg-color, #ffffff);z-index:9999;flex-direction:column;justify-content:center;align-items:center;padding:40px 20px;text-align:center}#auth-error.active{display:flex}.auth-error-icon{font-size:120px;margin-bottom:30px;animation:shake .5s ease-in-out}@keyframes shake{0%,to{transform:translate(0)}25%{transform:translate(-10px)}75%{transform:translate(10px)}}.auth-error-title{font-size:28px;font-weight:700;color:#dc2626;margin-bottom:16px}.auth-error-message{font-size:16px;color:var(--tg-theme-hint-color, #999);margin-bottom:12px;line-height:1.6}.auth-error-details{font-size:14px;color:var(--tg-theme-hint-color, #999);background:var(--tg-theme-secondary-bg-color, #f4f4f5);padding:16px;border-radius:12px;margin-top:24px;max-width:400px}#loading-screen{display:flex;position:fixed;inset:0;background:var(--tg-theme-bg-color, #ffffff);flex-direction:column;justify-content:center;align-items:center;z-index:999}#loading-screen.hidden{display:none}.loader{width:48px;height:48px;border:4px solid var(--tg-theme-hint-color, #e5e5e5);border-bottom-color:var(--tg-theme-button-color, #3390ec);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-text{margin-top:20px;font-size:14px;color:var(--tg-theme-hint-color, #999)}#main-content{display:none}#main-content.active{display:block}#inactive-user-error{display:none;position:fixed;inset:0;background:var(--tg-theme-bg-color, #ffffff);flex-direction:column;justify-content:center;align-items:center;padding:20px;z-index:1000;text-align:center}#inactive-user-error.active{display:flex}.inactive-user-icon{font-size:72px;margin-bottom:20px}.inactive-user-title{font-size:24px;font-weight:600;margin-bottom:12px;color:var(--tg-theme-text-color, #000)}.inactive-user-message{font-size:16px;color:var(--tg-theme-hint-color, #999);margin-bottom:30px;max-width:400px;line-height:1.5}#trades-list{margin:0;padding:0}.trades-table{width:100%;border-collapse:collapse;margin-top:8px;background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:12px;overflow:hidden}.trades-table thead{background:var(--tg-theme-button-color, #3390ec);color:var(--tg-theme-button-text-color, #ffffff)}.trades-table th{padding:8px 4px;text-align:center;font-size:10px;font-weight:600;text-transform:uppercase;vertical-align:middle;white-space:nowrap}.trades-table th:first-child{text-align:left;padding-left:8px}.trades-table th:last-child{padding-right:8px}.trades-table td{padding:10px 4px;font-size:13px;border-bottom:1px solid var(--tg-theme-hint-color, #e5e5e5);vertical-align:middle;text-align:center}.trades-table td:first-child{text-align:left;padding-left:8px}.trades-table td:last-child{padding-right:8px}.trades-table tbody tr:last-child td{border-bottom:none}.trades-table tbody tr:hover{background:#0000000d}.pnl-positive{color:#16a34a;font-weight:600}.pnl-negative{color:#dc2626;font-weight:600}.pnl-neutral{color:var(--tg-theme-hint-color, #999)}.stat-pnl-positive{color:#16a34a}.stat-pnl-negative{color:#dc2626}.bot-system-cell{font-size:12px;line-height:1.4}.bot-name{font-weight:600;color:var(--tg-theme-text-color, #000)}.system-name{color:var(--tg-theme-hint-color, #999)}.bot-name-clickable{cursor:pointer;-webkit-user-select:none;user-select:none}.bot-name-clickable:hover{opacity:.7}.bot-arrow{display:inline-block;margin-right:4px;transition:transform .2s}.bot-arrow.expanded{transform:rotate(90deg)}.trade-group-card{background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:12px;padding:12px;margin-bottom:12px}.trade-group-header{display:flex;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;padding-bottom:8px;border-bottom:1px solid var(--tg-theme-hint-color, #e5e5e5)}.trade-group-header:hover{opacity:.7}.trade-group-name{display:flex;align-items:center;gap:6px;font-size:16px;font-weight:600;color:var(--tg-theme-text-color, #000)}.trade-group-system{font-size:12px;font-weight:400;color:var(--tg-theme-hint-color, #999)}.trade-group-arrow{display:inline-block;transition:transform .2s;font-size:12px}.trade-group-arrow.expanded{transform:rotate(90deg)}.trade-group-pnl-container{display:flex;gap:6px;align-items:center}.trade-group-pnl{font-weight:600;font-size:14px}.trade-group-details{margin-top:8px;display:none}.trade-group-details.expanded{display:block}.trade-detail-item{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;margin:4px 0;background:#00000008;border-radius:6px;font-size:13px}.trade-detail-left{display:flex;gap:8px;align-items:center;flex:1;min-width:0}.trade-detail-ticker{font-weight:600;min-width:70px;max-width:120px;flex-shrink:0}.trade-detail-ticker-short{color:#dc2626}.trade-detail-side{min-width:55px;max-width:55px;font-weight:500;text-align:center;flex-shrink:0}.trade-detail-actions{display:flex;gap:4px;align-items:center;min-width:32px;flex-shrink:0}.trade-detail-size{min-width:60px;max-width:60px;color:var(--tg-theme-hint-color, #999);font-size:12px;text-align:right;flex-shrink:0}.trade-detail-right{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-shrink:0}.trade-detail-pnl{font-weight:600;font-size:12px;min-width:55px;text-align:right}.btn-toggle{padding:4px 8px;border:none;background:transparent;cursor:pointer;font-size:20px;transition:all .2s;opacity:.9}.btn-toggle:hover{opacity:1;transform:scale(1.15)}#telegram-login-container{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;margin-top:20px}.telegram-login-button{display:inline-flex;align-items:center;gap:8px;padding:12px 24px;background:#08c;color:#fff;border:none;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:background .3s;text-decoration:none}.telegram-login-button:hover{background:#069}.telegram-login-button svg{width:24px;height:24px;fill:#fff}#bots-list-container{padding:0;margin:0}.system-card{background:var(--tg-theme-secondary-bg-color, #f4f4f5);border-radius:12px;padding:12px;margin-bottom:12px}.system-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tg-theme-hint-color, #e5e5e5)}.system-name{font-size:16px;font-weight:600;color:var(--tg-theme-text-color, #000)}.system-name-clickable{cursor:pointer;-webkit-user-select:none;user-select:none;display:flex;align-items:center;gap:6px}.system-name-clickable:hover{opacity:.7}.system-arrow{display:inline-block;transition:transform .2s;font-size:12px}.system-arrow.expanded{transform:rotate(90deg)}.system-stats{display:flex;gap:16px;font-size:12px}.system-stat{display:flex;flex-direction:column;align-items:center}.system-stat-label{color:var(--tg-theme-hint-color, #999);font-size:10px}.system-stat-value{font-weight:600;font-size:13px}.system-signals{margin-top:8px}.signal-row{display:flex;justify-content:space-between;align-items:center;padding:6px 8px;margin:4px 0;background:#00000008;border-radius:6px;font-size:13px}.signal-asset{font-weight:600}.signal-side-long{color:#16a34a}.signal-side-short{color:#dc2626}.signal-size{font-weight:500;color:var(--tg-theme-text-color, #000)}#sistemas-list,#broker-positions-list,#broker-orders-list,#broker-history-list{padding:0;margin:0}.trade-action-btn{padding:2px 6px;border:none;border-radius:4px;cursor:pointer;font-size:14px;font-weight:700;transition:opacity .2s,transform .1s;background:transparent}.trade-action-btn:hover:not(:disabled){opacity:.8;transform:scale(1.05)}.trade-action-btn:active:not(:disabled){transform:scale(.95)}.trade-action-btn:disabled{opacity:.5;cursor:not-allowed}.trade-action-add{background-color:transparent;color:#27ae60}.trade-action-close{background-color:transparent;color:#e74c3c}.trade-action-repair{background-color:transparent;color:#f39c12}.modal-backdrop{position:fixed;inset:0;background-color:#0009;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px;animation:fadeIn .2s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.modal-content{background-color:var(--tg-theme-bg-color, #ffffff);border-radius:16px;max-width:500px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 10px 40px #0000004d;animation:slideUp .3s ease-out}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--tg-theme-section-separator-color, #e0e0e0)}.modal-header h3{margin:0;font-size:15px;font-weight:600;color:var(--tg-theme-text-color, #000000)}.modal-close-btn{background:transparent;border:none;font-size:24px;cursor:pointer;color:var(--tg-theme-hint-color, #999999);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:background-color .2s}.modal-close-btn:hover{background-color:var(--tg-theme-section-bg-color, #f0f0f0)}.modal-body{padding:16px}.detail-header{text-align:center;margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid var(--tg-theme-section-separator-color, #e0e0e0)}.detail-header h2{margin:0;font-size:16px;font-weight:700}.detail-header h2.side-long{color:#27ae60}.detail-header h2.side-short{color:#e74c3c}.detail-header-original{margin:4px 0 0;font-size:12px;color:var(--tg-theme-hint-color, #999999)}.detail-section{margin-bottom:14px}.detail-section h4{margin:0 0 8px;font-size:11px;font-weight:600;color:var(--tg-theme-subtitle-text-color, #666666);text-transform:uppercase;letter-spacing:.5px}.detail-row{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid var(--tg-theme-section-separator-color, #f0f0f0)}.detail-row:last-child{border-bottom:none}.detail-row.highlight{background-color:var(--tg-theme-section-bg-color, #f8f9fa);margin:6px -12px 0;padding:8px 12px;border-radius:6px;border-bottom:none}.detail-label{font-size:13px;color:var(--tg-theme-subtitle-text-color, #666666);font-weight:500}.detail-value{font-size:13px;font-weight:600;color:var(--tg-theme-text-color, #000000)}.pnl-positive{color:#27ae60!important}.pnl-negative{color:#e74c3c!important}.detail-table{width:100%;border-collapse:collapse;margin-top:8px}.detail-table th{background-color:var(--tg-theme-section-bg-color, #f8f9fa);padding:6px 8px;text-align:left;font-size:11px;font-weight:600;color:var(--tg-theme-subtitle-text-color, #666666);border-bottom:2px solid var(--tg-theme-section-separator-color, #e0e0e0)}.detail-table td{padding:6px 8px;font-size:12px;border-bottom:1px solid var(--tg-theme-section-separator-color, #f0f0f0)}.detail-table tbody tr:last-child td{border-bottom:none}.detail-table tbody tr:hover{background-color:var(--tg-theme-section-bg-color, #fafafa)}.warning-message{background-color:#fff3cd;color:#856404;padding:6px 10px;border-radius:4px;font-size:11px;margin-top:8px;border:1px solid #ffeeba;display:flex;align-items:center;gap:6px}.tpsl-list{list-style:none;padding:0;margin:6px 0 0}.tpsl-list li{padding:5px 10px;background-color:var(--tg-theme-section-bg-color, #f8f9fa);border-radius:4px;margin-bottom:4px;font-size:11px;font-family:Courier New,monospace}.tpsl-list li:last-child{margin-bottom:0}.detail-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--tg-theme-section-separator-color, #e0e0e0);text-align:center}.detail-footer small{color:var(--tg-theme-hint-color, #999999);font-size:10px}.loading{text-align:center;padding:40px 20px;color:var(--tg-theme-hint-color, #999999)}.error-message{background-color:#f8d7da;color:#721c24;padding:12px 16px;border-radius:8px;border:1px solid #f5c6cb;text-align:center}
