/* ── Dashboard Styles ─────────────────────────────────────────────── */

/* ── Login gate ──────────────────────────────────────────────────── */
#loginGate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.4rem;
  text-align: center;
  padding: 2rem;
}
#loginGate h2 { font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; }
#loginGate p  { color: var(--muted); font-size: .97rem; line-height: 1.7; }

/* ── Dashboard content ───────────────────────────────────────────── */
#dashContent { display: none; padding: 2rem 1.5rem 4rem; max-width: 980px; margin: 0 auto; }
.dash-header { margin-bottom: 2rem; }
.dash-header h1 { font-size: 1.8rem; font-weight: 900; letter-spacing: -.02em; }
.dash-header p  { color: var(--muted); font-size: .92rem; margin-top: .35rem; }

/* ── Stats summary row ──────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 640px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }

.summary-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.summary-num {
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.summary-label {
  font-size: .75rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; margin-top: .35rem; font-weight: 700;
}

/* ── Section heading ─────────────────────────────────────────────── */
.dash-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
}

/* ── Recent sessions table ───────────────────────────────────────── */
.sessions-table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}
.sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.sessions-table th {
  background: var(--bg);
  padding: .85rem 1.1rem;
  text-align: left;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1.5px solid var(--border);
}
.sessions-table td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  background: var(--surface);
}
.sessions-table tr:last-child td { border-bottom: none; }
.sessions-table tr:hover td { background: rgba(124,58,237,.03); }

.type-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  padding: .22rem .65rem;
  border-radius: 20px;
  letter-spacing: .04em;
}
.type-badge.practice {
  background: rgba(124,58,237,.1);
  color: var(--accent);
  border: 1px solid rgba(124,58,237,.2);
}
.type-badge.live {
  background: rgba(236,72,153,.1);
  color: var(--accent2);
  border: 1px solid rgba(236,72,153,.2);
}

.score-pill {
  font-weight: 800;
  padding: .2rem .6rem;
  border-radius: 8px;
  font-size: .88rem;
}
.score-pill.good { color: var(--success); }
.score-pill.mid  { color: var(--warn); }
.score-pill.bad  { color: var(--error); }

.verdict-chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  padding: .22rem .65rem;
  border-radius: 20px;
}
.verdict-chip.pass       { background: rgba(16,185,129,.12);  color: var(--success); border: 1px solid rgba(16,185,129,.2); }
.verdict-chip.borderline { background: rgba(245,158,11,.12);  color: var(--warn);    border: 1px solid rgba(245,158,11,.2); }
.verdict-chip.fail       { background: rgba(239,68,68,.12);   color: var(--error);   border: 1px solid rgba(239,68,68,.2); }

.date-cell { color: var(--muted); font-size: .82rem; font-weight: 500; }

/* ── Topic breakdown ─────────────────────────────────────────────── */
.topic-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.topic-stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.topic-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topic-stat-name  { font-size: .9rem; font-weight: 800; margin-bottom: .5rem; }
.topic-stat-row   { display: flex; justify-content: space-between; font-size: .83rem; color: var(--muted); margin-top: .25rem; }
.topic-stat-row span:last-child { color: var(--text); font-weight: 700; }

/* ── Progress bar inside topic card ─────────────────────────────── */
.mini-bar-bg {
  background: var(--border);
  border-radius: 4px;
  height: 5px;
  margin-top: .7rem;
  overflow: hidden;
}
.mini-bar-fill { height: 100%; border-radius: 4px; background: var(--grad); transition: width .5s ease; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
}
.empty-state a { color: var(--accent); text-decoration: none; font-weight: 700; }
.empty-state a:hover { text-decoration: underline; }

/* ── Loading ──────────────────────────────────────────────────────── */
.dash-loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-weight: 600;
}
