* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0f1419;
  color: #e7e9ea;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2f3336;
}

header h1 {
  font-size: 1.8rem;
  color: #1d9bf0;
}

.env-selector {
  display: flex;
  gap: 10px;
  align-items: center;
}

.env-selector label {
  color: #71767b;
}

select, input[type="text"], input[type="number"], input[type="password"] {
  background: #202327;
  border: 1px solid #2f3336;
  color: #e7e9ea;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
}

select:focus, input:focus {
  outline: none;
  border-color: #1d9bf0;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.card {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 20px;
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #e7e9ea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card h2 + button {
  margin-bottom: 15px;
}

button {
  background: #1d9bf0;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

button:hover {
  background: #1a8cd8;
}

button:disabled {
  background: #2f3336;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-size: 16px;
}

.content {
  margin-top: 15px;
}

.placeholder {
  color: #71767b;
  font-style: italic;
}

.balance-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2f3336;
}

.balance-item:last-child {
  border-bottom: none;
}

.balance-asset {
  font-weight: 600;
}

.balance-amount {
  color: #00ba7c;
}

.ticker-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.ticker-controls input {
  flex: 1;
}

.ticker-price {
  font-size: 2rem;
  font-weight: 700;
  color: #00ba7c;
}

.ticker-details {
  margin-top: 10px;
  color: #71767b;
  font-size: 0.9rem;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  margin-bottom: 5px;
  color: #71767b;
  font-size: 0.9rem;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row select {
  width: 100%;
}

.form-row input[type="checkbox"] {
  margin-right: 8px;
}

.order-item {
  background: #202327;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.order-item:last-child {
  margin-bottom: 0;
}

.order-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-pair {
  font-weight: 600;
}

.order-side-buy {
  color: #00ba7c;
}

.order-side-sell {
  color: #f91880;
}

.order-details {
  font-size: 0.85rem;
  color: #71767b;
}

.success {
  background: #00ba7c20;
  border: 1px solid #00ba7c;
  color: #00ba7c;
  padding: 12px;
  border-radius: 8px;
}

.error {
  background: #f9188020;
  border: 1px solid #f91880;
  color: #f91880;
  padding: 12px;
  border-radius: 8px;
}

.loading {
  color: #1d9bf0;
  font-style: italic;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #2f3336;
  text-align: center;
  color: #71767b;
  font-size: 0.85rem;
}

#api-url {
  color: #1d9bf0;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
  }

  .env-selector {
    flex-wrap: wrap;
  }

  main {
    grid-template-columns: 1fr;
  }
}
