* { box-sizing: border-box; }
body { font-family: system-ui, 'Segoe UI', sans-serif; margin: 0; background: #f0f2f5; }
button { cursor: pointer; pointer-events: auto !important; }
.header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.25rem; background: #1a237e; color: #fff; }
.header h1 { margin: 0; font-size: 1.15rem; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.header-actions a { color: rgba(255,255,255,0.9); text-decoration: none; }
.header-actions a:hover { text-decoration: underline; }
.header-actions button { padding: 0.35rem 0.75rem; background: rgba(255,255,255,0.2); border: none; color: #fff; border-radius: 6px; cursor: pointer; }
.header-actions button:hover { background: rgba(255,255,255,0.3); }
.screen { padding: 1rem; max-width: 960px; margin: 0 auto; }
.screen.hidden { display: none !important; }
.card { background: #fff; border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card h2 { margin: 0 0 0.5rem 0; font-size: 1rem; color: #333; }
.card h3 { margin: 0 0 0.5rem 0; font-size: 0.95rem; color: #444; }
.hint, .meta { font-size: 0.85rem; color: #666; margin: 0.5rem 0; }
.error { color: #c62828; }
.hidden { display: none; }
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { padding: 0.5rem 1rem; background: #fff; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; }
.tabs button.active { background: #1a237e; color: #fff; border-color: #1a237e; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.actions { margin-top: 0.5rem; }
.actions button { margin-right: 0.5rem; padding: 0.4rem 0.75rem; background: #3949ab; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.actions button.danger { background: #c62828; }
.form-section { font-size: 0.95rem; margin: 1.25rem 0 0.5rem 0; color: #333; border-bottom: 1px solid #eee; padding-bottom: 0.25rem; }
.form-section:first-of-type { margin-top: 0; }
.preset-row { display: flex; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.field-label { font-weight: 600; }
.field-desc { font-size: 0.75rem; color: #888; display: block; margin-bottom: 0.2rem; }
.test-result { margin-top: 0.5rem; padding: 0.5rem; border-radius: 4px; font-size: 0.9rem; min-height: 1.5rem; }
.test-result.ok { background: #e8f5e9; color: #2e7d32; }
.test-result.err { background: #ffebee; color: #c62828; }
.btn-test-broker { margin-right: 0.25rem; padding: 0.2rem 0.5rem; font-size: 0.8rem; background: #3949ab; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-test-broker:hover { background: #303f9f; }
.btn-edit-broker { margin-right: 0.25rem; padding: 0.2rem 0.5rem; font-size: 0.8rem; background: #2e7d32; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-edit-broker:hover { background: #1b5e20; }
.actions button.danger:hover { background: #b71c1c; }
.form-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; align-items: center; }
.form-row label { display: flex; flex-direction: column; gap: 0.25rem; }
.form-row input, .form-row select { padding: 0.4rem 0.6rem; }
.full-width { width: 100%; max-width: 400px; box-sizing: border-box; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #eee; }
th { background: #f5f5f5; font-weight: 600; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.ok { background: #22c55e; }
.status-dot.err { background: #ef4444; }
.status-dot.warn { background: #eab308; }
.status-dot.checking { background: #eab308; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.btn-secondary { background: #757575; color: #fff; }
.btn-secondary:hover { background: #616161; }
.login-card { max-width: 400px; margin: 2rem auto; }
.login-card label { display: block; margin-bottom: 0.5rem; }
.login-card input { width: 100%; padding: 0.5rem; margin-top: 0.25rem; }
.login-card button { margin-top: 0.75rem; padding: 0.5rem 1rem; background: #1a237e; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
pre { background: #f5f5f5; padding: 0.75rem; border-radius: 6px; overflow: auto; font-size: 0.85rem; white-space: pre-wrap; word-break: break-all; max-height: 300px; }
.broker-order-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.broker-order-list li { padding: 0.4rem 0.6rem; margin-bottom: 0.25rem; background: #f5f5f5; border-radius: 4px; }
.broker-order-list li:hover { background: #eee; }
code { font-family: monospace; font-size: 0.85em; background: #f0f0f0; padding: 0.1rem 0.3rem; border-radius: 4px; }
.footer { margin-top: 2rem; padding: 1rem; text-align: center; font-size: 0.85rem; color: #666; border-top: 1px solid #eee; }
.test-output { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; font-size: 0.8rem; max-height: 400px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin-top: 0.5rem; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.hidden { display: none; }
.modal-card { background: #fff; border-radius: 8px; padding: 1.25rem; max-width: 560px; width: 90%; max-height: 90vh; overflow: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.modal-card h2 { margin: 0 0 1rem 0; font-size: 1.1rem; }
.modal-card .form-row { margin-bottom: 0.75rem; }
.modal-card table { margin: 1rem 0; }
.modal-card #btnCloseUserTokensModal { margin-top: 1rem; }
