* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 30px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1a1a1a;
  border-radius: 20px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

.card {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 150px;
}

label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input,
select {
  width: 100%;
  padding: 12px 16px;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  border-color: #4a9eff;
}

input::placeholder {
  color: #555;
}

input[type="datetime-local"] {
  cursor: pointer;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #4a9eff;
  color: #fff;
}

.btn-primary:hover {
  background: #3a8eef;
}

.btn-secondary {
  background: #2a2a2a;
  color: #fff;
}

.btn-secondary:hover {
  background: #3a3a3a;
}

.btn-danger {
  background: #e53935;
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #2a2a2a;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  font-weight: 500;
}

td {
  font-size: 13px;
}

tr:hover {
  background: #222;
}

.group-header {
  background: #1f1f1f;
  cursor: pointer;
  user-select: none;
}

.group-header:hover {
  background: #2a2a2a;
}

.group-header td {
  font-weight: 600;
  padding: 14px 12px;
}

.group-toggle {
  display: inline-block;
  width: 20px;
  transition: transform 0.2s;
}

.group-toggle.collapsed {
  transform: rotate(-90deg);
}

.market-row {
  background: #181818;
}

.market-row td {
  padding-left: 32px;
}

.interval-row td {
  padding-left: 56px;
  font-size: 12px;
}

.interval-row:hover {
  background: #252525;
}

.hidden-row {
  display: none;
}

.btn-icon {
  padding: 4px 8px;
  font-size: 11px;
  background: transparent;
  border: 1px solid #444;
  color: #888;
}

.btn-icon:hover {
  background: #333;
  color: #fff;
  border-color: #666;
}

.btn-icon.btn-danger {
  border-color: #5a2020;
  color: #e57373;
}

.btn-icon.btn-danger:hover {
  background: #5a2020;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-success {
  background: #1b5e20;
  color: #4caf50;
}

.badge-warning {
  background: #e65100;
  color: #ff9800;
}

.badge-info {
  background: #0d47a1;
  color: #2196f3;
}

.badge-error {
  background: #b71c1c;
  color: #f44336;
}

.badge-spot {
  background: #1a237e;
  color: #7c4dff;
}

.badge-futures {
  background: #004d40;
  color: #1de9b6;
}

.symbol-link {
  color: #4a9eff;
  cursor: pointer;
  font-weight: 500;
}

.symbol-link:hover {
  text-decoration: underline;
}

.number {
  font-family: 'SF Mono', Monaco, monospace;
  color: #fff;
}

.date {
  color: #888;
  font-size: 12px;
}

.active-jobs {
  margin-bottom: 20px;
}

.job-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #0f0f0f;
  border-radius: 8px;
  margin-bottom: 8px;
}

.job-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.job-symbol {
  font-weight: 600;
  color: #fff;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #4a9eff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  color: #fff;
  background: #2a2a2a;
}

.tab.active {
  color: #fff;
  background: #2a2a2a;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
}

.gap-list {
  max-height: 300px;
  overflow-y: auto;
}

.gap-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #555;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  background: #2a2a2a;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 1001;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #4caf50;
}

.toast.error {
  border-left: 4px solid #f44336;
}

.toast.info {
  border-left: 4px solid #2196f3;
}

.refresh-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.refresh-btn:hover {
  color: #fff;
  background: #2a2a2a;
}

.logs-container {
  background: #0a0a0a;
  border-radius: 8px;
  padding: 12px;
  height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.log-entry {
  padding: 2px 0;
  border-bottom: 1px solid #1a1a1a;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: #666;
  margin-right: 8px;
}

.log-level {
  display: inline-block;
  width: 50px;
  font-weight: 600;
  margin-right: 8px;
}

.log-level.INFO {
  color: #4a9eff;
}

.log-level.WARN {
  color: #ff9800;
}

.log-level.ERROR {
  color: #f44336;
}

.log-level.DEBUG {
  color: #888;
}

.log-message {
  color: #e0e0e0;
}

.log-attrs {
  color: #888;
  margin-left: 8px;
}

/* Chart Styles */
.chart-container {
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #141414;
  border-bottom: 1px solid #2a2a2a;
}

.chart-symbol {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.chart-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.interval-selector {
  display: flex;
  gap: 2px;
  background: #1a1a1a;
  padding: 2px;
  border-radius: 6px;
}

.interval-btn {
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.interval-btn:hover {
  color: #fff;
  background: #2a2a2a;
}

.interval-btn.active {
  color: #fff;
  background: #4a9eff;
}

.chart-area {
  height: 450px;
  width: 100%;
}

.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 450px;
  color: #666;
}

.chart-info {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  background: #141414;
  font-size: 12px;
  color: #888;
  border-top: 1px solid #2a2a2a;
}

.chart-info-item {
  display: flex;
  gap: 6px;
}

.chart-info-label {
  color: #666;
}

.chart-info-value {
  color: #fff;
  font-family: 'SF Mono', Monaco, monospace;
}

.chart-info-value.positive {
  color: #4caf50;
}

.chart-info-value.negative {
  color: #f44336;
}

.custom-interval-input {
  width: 60px;
  padding: 6px 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.custom-interval-input:focus {
  border-color: #4a9eff;
  outline: none;
}

.chart-loading-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes chartLoadSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#chartLoadingIndicator {
  animation: chartLoadSpin 1s linear infinite;
  display: inline-block;
}