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

:root {
  --bg: #0c0c14;
  --surface: #16162a;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --teal: #00cec9;
  --pink: #fd79a8;
  --orange: #e17055;
  --danger: #ff6b6b;
  --text: #eef0ff;
  --text-dim: #7a7a9e;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 206, 201, 0.1) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

.login-container {
  background: var(--surface);
  padding: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
}

.login-container h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.login-container label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.login-container input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f0f1c;
  color: var(--text);
  margin-bottom: 1rem;
}

.login-container button,
.header-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.flash-alert {
  color: var(--danger);
  margin-bottom: 1rem;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dashboard-header h1 {
  font-size: 1.8rem;
}

.dashboard-subtitle {
  color: var(--text-dim);
}

.methodology {
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.panel-error {
  border-color: rgba(255, 107, 107, 0.4);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.legend-item::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.legend-a::before { background: var(--accent-light); }
.legend-b::before { background: var(--teal); }
.legend-c::before { background: var(--orange); }
.legend-d::before { background: var(--pink); }

.chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-height: 220px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.chart-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 180px;
}

.chart-bar {
  width: 10px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.chart-bar-add { background: var(--accent-light); }
.chart-bar-view { background: var(--teal); }
.chart-bar-checkout { background: var(--orange); }
.chart-bar-purchase { background: var(--pink); }

.chart-label {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-dim);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 72px;
}

.week-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.week-picker select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f0f1c;
  color: var(--text);
}

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

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  color: var(--text-dim);
  font-weight: 600;
}

.legacy-note {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
