/* Arbitrading Bot — Dark theme dashboard */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0f1419;
  color: #e6e6e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #11161c;
  border-bottom: 1px solid #1f2933;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { margin: 0; font-size: 20px; color: #4fc3f7; }
.header-right { display: flex; align-items: center; gap: 14px; }

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 20px;
}

.panel {
  background: #151b22;
  border: 1px solid #1f2933;
  border-radius: 8px;
  padding: 18px 20px;
}
.panel h2 {
  margin: 0 0 14px 0;
  font-size: 16px;
  color: #9aa4b1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-idle    { background: #37424f; color: #c2d1e0; }
.badge-running { background: #2e7d32; color: #e8f5e9; }
.badge-error   { background: #c62828; color: #ffebee; }

.logout {
  color: #7fa7c7;
  text-decoration: none;
  font-size: 13px;
}
.logout:hover { color: #fff; }

/* Metrics grid */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.metric {
  background: #0f1419;
  border: 1px solid #1f2933;
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}
.metric-label {
  color: #6b7885;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.metric span:last-child {
  color: #e6e6e6;
  font-size: 15px;
  font-weight: 500;
  word-break: break-all;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:not(:disabled):hover { opacity: 0.85; }
.btn-green  { background: #2e7d32; }
.btn-red    { background: #c62828; }
.btn-orange { background: #ef6c00; }

.msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  min-height: 20px;
}
.msg.ok    { background: #1b5e20; color: #e8f5e9; }
.msg.error { background: #b71c1c; color: #ffebee; }

/* Config form */
.cfg-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cfg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cfg-row label {
  color: #6b7885;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cfg-row input,
.cfg-row select {
  background: #0f1419;
  border: 1px solid #1f2933;
  color: #e6e6e6;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.cfg-row input:focus,
.cfg-row select:focus {
  outline: none;
  border-color: #4fc3f7;
}
.cfg-notice {
  margin-top: 12px;
  padding: 10px 12px;
  background: #1f2933;
  border-left: 3px solid #ef6c00;
  color: #c2d1e0;
  font-size: 12px;
  border-radius: 4px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #1f2933;
}
th {
  color: #6b7885;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  background: #11161c;
}
tr:hover td { background: #1a222b; }

/* Login page */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}
.login-box {
  background: #151b22;
  border: 1px solid #1f2933;
  padding: 40px;
  border-radius: 8px;
  width: 320px;
}
.login-box h1 { margin: 0 0 24px 0; color: #4fc3f7; font-size: 22px; }
.login-box label {
  color: #6b7885;
  font-size: 11px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.login-box input {
  width: 100%;
  background: #0f1419;
  border: 1px solid #1f2933;
  color: #e6e6e6;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}
.login-box button {
  width: 100%;
  padding: 10px;
  background: #4fc3f7;
  color: #0f1419;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.login-box .error {
  margin-top: 14px;
  padding: 8px 10px;
  background: #b71c1c;
  color: #ffebee;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 800px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cfg-form { grid-template-columns: 1fr; }
}
