* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #e6e8eb;
}
.hidden { display: none !important; }
.muted { color: #8b93a1; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #171a21;
  border: 1px solid #262b36;
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-box h1 { margin: 0 0 8px; font-size: 20px; }
.login-box input[type="password"] {
  background: #0f1115;
  border: 1px solid #2c3140;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e6e8eb;
  font-size: 14px;
}
.remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #a9b1bd; }
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}
.login-box button[type="submit"] { background: #3b82f6; color: white; }
.btn-secondary { background: #262b36; color: #e6e8eb; }
.btn-danger { background: #dc2626; color: white; }
.btn-primary { background: #22c55e; color: white; }
.error { color: #f87171; font-size: 13px; margin: 0; }

.app-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
header h1 { font-size: 18px; margin: 0; }
section { margin-bottom: 32px; }
section h2 { font-size: 15px; color: #a9b1bd; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; background: #171a21; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid #232733; white-space: nowrap; }
th { color: #8b93a1; font-weight: 600; background: #1b1f28; }
tbody tr:hover { background: #1c202b; }
.pnl-pos { color: #4ade80; font-weight: 600; }
.pnl-neg { color: #f87171; font-weight: 600; }

.bot-info-card {
  background: #171a21; border: 1px solid #262b36; border-radius: 10px;
  padding: 16px 20px; display: flex; gap: 28px; flex-wrap: wrap;
}
.bot-info-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bot-info-row b { font-size: 15px; }

.log-box {
  background: #0b0d11; border: 1px solid #262b36; border-radius: 10px;
  padding: 14px 16px; font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 12px; color: #9dd3ff; overflow-x: auto; white-space: pre-wrap;
  min-height: 90px; margin: 0;
}

.pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; justify-content: flex-end; }
.pager span { font-size: 13px; color: #8b93a1; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
.modal-box { background: #171a21; border: 1px solid #262b36; border-radius: 12px; padding: 24px; width: 320px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

@media (max-width: 700px) {
  #positionsTableWrap, #realizationsTableWrap { overflow-x: auto; }
}
