/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #131722;
  color: #d1d4dc;
  font-size: 13px;
}

/* ============================================================
   LOGIN
   ============================================================ */
#login-overlay {
  position: fixed;
  inset: 0;
  background: #0d0f16;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 12px;
  padding: 40px 36px;
  width: 360px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  color: #f0a500;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.login-subtitle {
  color: #787b86;
  font-size: 13px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: #131722;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  color: #d1d4dc;
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: #f0a500;
}

.login-error {
  color: #ef5350;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(239, 83, 80, 0.1);
  border-radius: 4px;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: #f0a500;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #f5b930;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  height: 48px;
  flex-shrink: 0;
  background: #1e222d;
  border-bottom: 1px solid #2a2e39;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  font-size: 16px;
  font-weight: 700;
  color: #f0a500;
  letter-spacing: -0.3px;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticker-input {
  background: #131722;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  color: #d1d4dc;
  font-size: 13px;
  padding: 4px 8px;
  width: 90px;
  font-weight: 600;
  text-transform: uppercase;
}

.ticker-input:focus {
  outline: none;
  border-color: #f0a500;
}

.price-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price {
  font-size: 15px;
  font-weight: 600;
}

.change {
  font-size: 12px;
}

.change.positive {
  color: #26a69a;
}

.change.negative {
  color: #ef5350;
}

.user-email {
  color: #787b86;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #2a2e39;
  color: #d1d4dc;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.15s;
}

.btn-ghost:hover {
  border-color: #787b86;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  height: 40px;
  flex-shrink: 0;
  background: #1e222d;
  border-bottom: 1px solid #2a2e39;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 4px;
  overflow-x: auto;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: #2a2e39;
  margin: 0 8px;
  flex-shrink: 0;
}

.range-btn {
  background: transparent;
  border: none;
  color: #787b86;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.range-btn:hover {
  color: #d1d4dc;
  background: #2a2e39;
}

.range-btn.active {
  color: #f0a500;
  background: rgba(240, 165, 0, 0.1);
}

.ind-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #787b86;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
}

.ind-btn:hover {
  color: #d1d4dc;
  border-color: #2a2e39;
}

.ind-btn.active {
  color: #d1d4dc;
  border-color: #363a45;
  background: #2a2e39;
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #787b86;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.tool-btn:hover {
  color: #d1d4dc;
  border-color: #2a2e39;
}

.tool-btn.active {
  color: #f0a500;
  border-color: rgba(240, 165, 0, 0.4);
  background: rgba(240, 165, 0, 0.08);
}

.loading-indicator {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #2a2e39;
  border-top-color: #f0a500;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CHART AREA
   ============================================================ */
.chart-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #131722;
  min-height: 0;
}

.chart-main {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.chart-panel {
  flex-shrink: 0;
  height: 120px;
  border-top: 1px solid #2a2e39;
  position: relative;
  overflow: hidden;
}

.panel-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 10px;
  color: #4c525e;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.chart-panel-inner {
  width: 100%;
  height: 100%;
}
