/* ─── Dashboard inherits base tokens from style.css ─────────── */
/* NOTE: dashboard.html links both style.css AND dashboard.css   */

/* ─── Dashboard layout ───────────────────────────────────────── */
.dash-app {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.dash-sidebar {
  flex-shrink: 0;
  width: 200px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dash-sidebar-title {
  font-family: var(--font-display);
  font-size: 8.5px;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--border);
}

.dash-nav { display: flex; flex-direction: column; padding: 8px 0; }
.dash-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer; border: none; background: transparent;
  text-align: left;
  transition: background 0.14s, color 0.14s;
  position: relative;
}
.dash-nav-item:hover  { background: var(--panel2); color: var(--text-main); }
.dash-nav-item.active { background: var(--panel3); color: var(--gold); }
.dash-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; background: var(--gold); border-radius: 0 2px 2px 0;
}
.dash-nav-icon { font-size: 14px; width: 18px; text-align: center; }

.dash-civ-section {
  padding: 12px 16px 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.dash-civ-label {
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.13em;
  color: var(--text-faint); text-transform: uppercase;
  margin-bottom: 8px;
}
.dash-civ-select {
  width: 100%;
  background: var(--panel3); color: var(--text-main);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px;
  font-family: var(--font-body); font-size: 13px;
  outline: none; cursor: pointer;
  transition: border-color 0.14s;
}
.dash-civ-select:focus { border-color: var(--gold-dim); }
.dash-civ-select option { background: var(--panel2); }

.logout-btn {
  margin: auto 16px 16px;
  font-family: var(--font-display);
  font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-faint);
  cursor: pointer; border-radius: var(--radius);
  transition: all 0.14s;
}
.logout-btn:hover {
  border-color: var(--rust); color: #e06050;
  background: rgba(139,58,42,0.1);
}

/* ─── Dashboard main ─────────────────────────────────────────── */
.dash-main {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 24px;
}

.dash-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-faint); font-style: italic;
}

/* ─── View panels ────────────────────────────────────────────── */
.dash-view { display: none; flex-direction: column; gap: 22px; }
.dash-view.active { display: flex; }

.dash-section-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--gold); letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.dash-section-sub {
  font-size: 13px; color: var(--text-faint); font-style: italic;
}

/* ─── Chart cards ────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.chart-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.chart-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,0.3), transparent);
}
.chart-card-title {
  font-family: var(--font-display);
  font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-dim);
}
.chart-card canvas {
  max-height: 260px;
}

/* full-width chart card */
.chart-card.full {
  grid-column: 1 / -1;
}
.chart-card.full canvas {
  max-height: 320px;
}

/* ─── Stats overview cards ───────────────────────────────────── */
.stat-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.stat-overview-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.soc-label {
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint);
}
.soc-val {
  font-size: 24px; font-weight: 700; color: var(--gold-pale);
  line-height: 1;
}
.soc-sub { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* ─── Matchup matrix ─────────────────────────────────────────── */
.matchup-wrapper {
  overflow-x: auto;
}
.matchup-table {
  border-collapse: collapse;
  font-size: 11px;
  min-width: 600px;
}
.matchup-table th, .matchup-table td {
  padding: 5px 7px;
  border: 1px solid rgba(201,162,39,0.12);
  text-align: center;
  white-space: nowrap;
}
.matchup-table th {
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.08em;
  color: var(--text-dim); background: var(--panel3);
  font-weight: 400;
}
.matchup-table td {
  font-weight: 600;
  transition: opacity 0.15s;
}
.matchup-table td:hover { opacity: 0.8; }
.matchup-cell-self { background: var(--panel3); color: var(--text-faint); }

/* ─── Civ profile view ───────────────────────────────────────── */
.profile-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-emblem {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 50%; border: 1px solid var(--border-bright);
}
.profile-emblem-fallback {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--gold); background: var(--panel3);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; color: var(--gold);
}
.profile-sub { font-size: 13px; color: var(--text-dim); font-style: italic; }

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chart-card { animation: fadeIn 0.25s ease both; }
.chart-card:nth-child(2) { animation-delay: 0.05s; }
.chart-card:nth-child(3) { animation-delay: 0.10s; }
.chart-card:nth-child(4) { animation-delay: 0.15s; }
