/* ============================================================
   CrossWord — progress.css
   Phase 9: Progress Dashboard — cards, bars, author groups,
   book list, recent activity.
   ============================================================ */

/* ── Dashboard header ────────────────────────────────────── */
.dash-header {
    padding: var(--sp-md) var(--sp-md) 0;
}

.dash-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--navy);
    margin: 0;
}

/* ── Cards ───────────────────────────────────────────────── */
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-md);
    margin: var(--sp-md) var(--sp-md) 0;
    box-shadow: var(--shadow-sm);
}

.dash-card:last-child {
    margin-bottom: var(--sp-md);
}

.dash-card-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--sp-md);
}

/* ── Stat row ────────────────────────────────────────────── */
.dash-stat-row {
    display: flex;
    gap: var(--sp-lg);
    flex-wrap: wrap;
    margin-bottom: var(--sp-md);
}

.dash-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--navy);
    font-weight: 600;
    line-height: 1;
}

.dash-stat-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Progress bars ───────────────────────────────────────── */
.dash-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--sp-sm);
}

.dash-bar-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.dash-bar-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    width: 72px;
    flex-shrink: 0;
}

.dash-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--r-pill);
    overflow: hidden;
}

.dash-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width 0.6s var(--ease-out);
}

.dash-bar-pct {
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--text-muted);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.dash-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: var(--sp-xs) 0 0;
}

/* ── Flashcard queue ─────────────────────────────────────── */
.dash-streak {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--navy-mid);
    margin-bottom: var(--sp-sm);
}

.dash-review-btn {
    margin-top: var(--sp-xs);
}

/* ── Recent activity ─────────────────────────────────────── */
.recent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.recent-row:last-child { border-bottom: none; }

.recent-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.recent-ref {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--navy);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ── By Author ───────────────────────────────────────────── */
.author-group {
    border-bottom: 1px solid var(--border-light);
}

.author-group:last-child { border-bottom: none; }

.author-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-sm) 0;
    cursor: pointer;
    user-select: none;
}

.author-group-header:hover { background: var(--surface-raised); border-radius: var(--r-sm); }

.author-group-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.author-name {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--navy);
    font-weight: 600;
}

.author-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.author-group-stats {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.author-pct {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--navy-mid);
    font-weight: 600;
}

.author-chevron {
    color: var(--text-muted);
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.author-detail {
    padding: 0 0 var(--sp-sm);
}

/* ── By Book ─────────────────────────────────────────────── */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 400px;
    overflow-y: auto;
}

.book-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
}

.book-row:last-child { border-bottom: none; }

.book-row-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 110px;
    flex-shrink: 0;
}

.book-row-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.book-read-dot   { color: var(--green);      font-size: 0.5rem; }
.book-unread-dot { color: var(--border);      font-size: 0.5rem; }

.book-row-bars {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}

.book-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--r-pill);
    overflow: hidden;
}

.book-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width 0.5s var(--ease-out);
}

.book-pct {
    font-family: var(--font-display);
    font-size: 0.6rem;
    color: var(--text-muted);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}
