:root {
  --bg-color: #0d0d0d;
  --surface-color: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-color: #3b82f6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.5;
  overflow-x: hidden;
}

.glass {
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

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

/* Header & Stats */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* Positions Table */
.card {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

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

th {
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-long { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.badge-short { background: rgba(239, 68, 68, 0.2); color: var(--danger-color); }

/* Kill Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--danger-color);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px; width: 26px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--success-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* Log Stream */
#log-stream {
  height: 200px;
  overflow-y: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  padding: 1rem;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}

.log-entry { margin-bottom: 0.25rem; }
.log-ts { color: var(--text-secondary); margin-right: 0.5rem; }

/* Login */
.login-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
}

input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  margin: 1rem 0;
}

button {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover { opacity: 0.9; }

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.update-flash {
  animation: pulse 0.3s ease-in-out;
}
