:root {
  --bg: #0b0f19;
  --surface: #111827;
  --surface-2: #1f2937;
  --border: #2d3a4f;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
  min-height: 100vh;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: var(--muted);
  margin-top: 4px;
}

.sound-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.3s, background 0.3s;
}

.sound-btn:hover {
  border-color: var(--blue);
  background: var(--surface);
}

.sound-btn.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--green);
  color: var(--green);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.3s;
}

.card:hover {
  border-color: var(--blue);
}

.card span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.value {
  font-size: 1.8rem;
  font-weight: 700;
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.arrow {
  font-size: 1.5rem;
  font-weight: 700;
}

#qtyInput,
.alert-inputs input,
.month-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

#qtyInput:focus,
.alert-inputs input:focus,
.month-select:focus {
  border-color: var(--blue);
}

.alert-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-status {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  min-height: 30px;
}

.alert-status.triggered {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}

.alert-status.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid var(--green);
}

.patrimony-value {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.patrimony-diff {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-section span {
  color: var(--muted);
  font-weight: 600;
}

.filter-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.filter-btn:hover {
  border-color: var(--blue);
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-card h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.chart-wrapper {
  height: 350px;
  position: relative;
}

.recent-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-title {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
}

.recent-item.up span:last-child {
  color: var(--green);
  font-weight: 600;
}

.recent-item.down span:last-child {
  color: var(--red);
  font-weight: 600;
}

.recent-item.neutral span:last-child {
  color: var(--muted);
}

@media (max-width: 600px) {
  body {
    padding: 16px;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .value {
    font-size: 1.4rem;
  }

  .chart-wrapper {
    height: 280px;
  }
}