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

:root {
  --bg: #131722;
  --panel: #1e222d;
  --border: #2a2e39;
  --text: #d1d4dc;
  --muted: #787b86;
  --accent: #2962ff;
  --error: #f7525f;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }
.error { color: var(--error); font-size: 0.85rem; min-height: 1.2em; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover { filter: brightness(1.15); }

input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 0.9rem;
}
input:focus { outline: 1px solid var(--accent); }

/* Login */
#login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
.login-box p { color: var(--muted); font-size: 0.9rem; }
.login-box p.error { color: var(--error); }
#login-step-verify { display: flex; gap: 0.5rem; }
#code-input { flex: 1; text-align: center; letter-spacing: 0.3em; }

/* App layout */
#app { display: flex; height: 100vh; }

#sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#sidebar h1 { font-size: 1.1rem; }

#add-form { display: flex; gap: 0.4rem; }
#symbol-input { flex: 1; min-width: 0; }

#watchlist { list-style: none; flex: 1; overflow-y: auto; }
#watchlist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
#watchlist li:hover { background: var(--border); }
#watchlist li.active { background: var(--accent); color: #fff; }
#watchlist li .remove {
  background: none;
  color: var(--muted);
  padding: 0 0.3rem;
  font-size: 1rem;
}
#watchlist li .remove:hover { color: var(--error); }

#btn-logout { background: var(--border); color: var(--muted); }

main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

#toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
#current-symbol { font-size: 1.1rem; font-weight: 700; min-width: 5rem; }

#intervals { display: flex; gap: 0.3rem; }
#intervals button {
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
}
#intervals button.active { background: var(--accent); color: #fff; }

#chart { flex: 1; min-height: 0; }
