/* ── Stat cards ─────────────────────────────────────────────────── */
.dash-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}
.dash-stat-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transition: transform 160ms ease;
}
.dash-stat-card:hover  { transform: translateY(-3px); }
.dash-stat-card.phishing  { border-color: rgba(239,68,68,0.3); }
.dash-stat-card.blocked   { border-color: rgba(245,158,11,0.3); }
.dash-stat-card.ok        { border-color: rgba(34,197,94,0.3);  }
.dash-stat-card.quiz      { border-color: rgba(96,165,250,0.3); }
.dash-stat-card.quiz-avg  { border-color: rgba(168,85,247,0.3); }

.dash-stat-number { font-size: 1.9rem; font-weight: 700; color: #fff; line-height: 1; }
.dash-stat-label  { font-size: 0.75rem; color: var(--muted); text-align: center; }

/* ── Bar chart ──────────────────────────────────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 0.75rem; }
.bar-row   { display: flex; align-items: center; gap: 0.8rem; }
.bar-label { width: 72px; font-size: 0.82rem; color: var(--muted); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; background: rgba(255,255,255,0.06); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 999px; width: 0%; transition: width 700ms cubic-bezier(.4,0,.2,1); }
.bar-val   { width: 24px; text-align: right; font-size: 0.82rem; color: var(--muted); }

.phishing-bar { background: linear-gradient(90deg, #ef4444, #f87171); }
.blocked-bar  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ok-bar       { background: linear-gradient(90deg, #22c55e, #4ade80); }
.quiz-bar     { background: linear-gradient(90deg, #60a5fa, #93c5fd); }

/* ── Quiz score history ─────────────────────────────────────────── */
.score-history { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.5rem; }
.score-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}
.score-idx    { width: 28px; flex-shrink: 0; }
.score-track  { flex: 1; min-width: 60px; background: rgba(255,255,255,0.06); border-radius: 999px; height: 8px; overflow: hidden; }
.score-bar    { height: 100%; border-radius: 999px; transition: width 500ms ease; }
.score-val    { width: 80px; flex-shrink: 0; }

/* ── Filter dropdown ────────────────────────────────────────────── */
.dash-filter {
    background: #0b1224;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
}
.dash-filter:focus { outline: 2px solid rgba(96,165,250,0.5); }

/* ── Clear button ─────────────────���─────────────────────────────── */
.btn-clear {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 140ms ease;
}
.btn-clear:hover { background: rgba(239,68,68,0.22); }

/* ── Table ──────────────────────────────────────────────────────── */
.dash-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dash-table th {
    text-align: left;
    padding: 0.5rem 0.7rem;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dash-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td      { background: rgba(255,255,255,0.025); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
}
.badge-phishing { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-blocked  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-ok       { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-quiz     { background: rgba(96,165,250,0.15); color: #93c5fd; }
.badge-default  { background: rgba(255,255,255,0.08); color: var(--muted); }

/* ── Pagination ─────────────────────────────────────────────────── */
.dash-pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.9rem; }
.pag-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    width: 34px; height: 34px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 120ms ease;
}
.pag-btn:hover  { background: rgba(96,165,250,0.15); }
.pag-active     { background: var(--accent-strong) !important; border-color: var(--accent-strong) !important; color: #fff !important; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .dash-summary { grid-template-columns: repeat(3, 1fr); }
    .dash-table th:nth-child(4),
    .dash-table td:nth-child(4) { display: none; }
    .dash-table-header { flex-direction: column; align-items: flex-start; }
}