/* ===================================================================
   Trading Bot Dashboard — Dark Theme
   =================================================================== */

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:   #0d1117;
  --bg-secondary: #161b22;
  --bg-card:      #1c2128;
  --bg-input:     #21262d;
  --border:       #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent:       #00d4aa;
  --accent-dim:   rgba(0, 212, 170, 0.15);
  --positive:     #3fb950;
  --negative:     #f85149;
  --warning:      #d29922;
  --font:         "Inter", "Segoe UI", system-ui, sans-serif;
  --radius:       6px;
  --shadow:       0 2px 8px rgba(0,0,0,0.4);
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navbar ---- */
.navbar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.brand-icon { font-size: 18px; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  margin-left: 32px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.status-dot.online { background: var(--positive); }
.status-dot.offline { background: var(--negative); }

/* ---- Main layout ---- */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 99px;
  font-weight: 600;
}

.card-body {
  padding: 16px;
}

/* ---- Live page grid ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

/* ---- Account stats ---- */
.account-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.stat .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- Colors ---- */
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-input); }

/* ---- Watchlist ---- */
.watchlist {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.ticker-item {
  padding: 4px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- Utility text ---- */
.no-data, .loading {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 13px;
}

.error {
  color: var(--negative);
  font-size: 13px;
}

/* ---- History layout ---- */
.history-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card .card-body {
  padding: 16px;
  background: var(--bg-card);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.date-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
}

.metrics-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.metric .value {
  font-size: 18px;
  font-weight: 700;
}

/* ---- Settings layout ---- */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section { margin-bottom: 20px; }
.settings-section:last-child { margin-bottom: 0; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.settings-label {
  width: 220px;
  font-size: 13px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.settings-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  width: 160px;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

.btn-primary:hover { opacity: 0.85; text-decoration: none; color: #000; }

.btn-secondary {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover { background: var(--border); }

.btn-save {
  padding: 4px 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover { background: var(--accent); color: #000; }

/* ---- Toast notifications ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
}

.toast-success { background: var(--positive); color: #000; }
.toast-error   { background: var(--negative); color: #fff; }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---- Login page ---- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  text-align: center;
}

.login-logo {
  margin-bottom: 32px;
}

.login-logo .brand-icon {
  display: block;
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn-google {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
  justify-content: center;
}

.btn-google:hover { opacity: 0.9; }

.auth-disabled-msg {
  color: var(--text-secondary);
  font-size: 13px;
}
