/* Step Ahead IELTS — Student Home Dashboard (Phase 4, Academic Trust design) */

#home-dashboard-panel {
    margin: 0 0 1.25rem;
    width: 100%;
}

.hd-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #D8DEE9);
    border-radius: var(--border-radius, 10px);
    overflow: hidden;
}

.hd-header {
    background: var(--primary, #14213D);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.8rem 1.25rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hd-header > span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Goal selector (Phase 4) */
.hd-goal {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.hd-goal-select {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #14213D;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

/* New feedback notice (Phase 4) */
.hd-feedback-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    background: var(--accent-light, #FDF6E7);
    border-bottom: 1px solid var(--border, #D8DEE9);
}

.hd-fb-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent, #F0A202);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.hd-fb-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    color: var(--dark, #14213D);
}

.hd-fb-text span {
    color: var(--dark-muted, #5B6B85);
    font-size: 0.76rem;
}

.hd-fb-btn {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary, #14213D);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.hd-fb-btn:hover { text-decoration: none; filter: brightness(1.15); }

.hd-fb-dismiss {
    background: none;
    border: none;
    color: var(--dark-muted, #5B6B85);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.hd-fb-dismiss:hover { color: var(--danger-text, #B3362B); }

/* Stats row — 5 cards on desktop */
.hd-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.25rem;
}

.hd-stats-5 {
    grid-template-columns: repeat(5, 1fr);
}

.hd-stat-card {
    text-align: center;
    padding: 0.9rem 0.5rem;
    border: 1px solid var(--border, #D8DEE9);
    border-radius: 8px;
    background: var(--surface, #fff);
}

.hd-stat-icon {
    color: var(--primary, #14213D);
    display: inline-flex;
    margin-bottom: 0.35rem;
}

.hd-stat-value {
    font-family: var(--font-heading, inherit);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--dark, #14213D);
    line-height: 1.1;
}

.hd-stat-label {
    font-size: 0.68rem;
    color: var(--dark-muted, #5B6B85);
    font-weight: 600;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Goal progress (Phase 4) */
.hd-goal-progress {
    padding: 0.75rem 1.25rem 0.25rem;
}

.hd-goal-bar {
    height: 6px;
    background: var(--light, #EDF1F7);
    border-radius: 999px;
    overflow: hidden;
}

.hd-goal-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.hd-goal-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark-muted, #5B6B85);
    margin-top: 0.4rem;
}

.hd-goal-note.ok { color: var(--success-text, #2F7D4F); }

/* Skill averages — progress bars (Phase 4) */
.hd-skills {
    padding: 0.9rem 1.25rem 0.25rem;
}

.hd-skill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.hd-skill {
    margin-bottom: 0.6rem;
}

.hd-skill-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.hd-skill-label {
    color: var(--dark-muted, #5B6B85);
    font-weight: 600;
    font-size: 0.78rem;
}

.hd-skill-band {
    color: var(--dark, #14213D);
    font-size: 0.82rem;
}

.hd-skill-track {
    height: 6px;
    background: var(--light, #EDF1F7);
    border-radius: 999px;
    overflow: hidden;
}

.hd-skill-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.hd-skill-count {
    display: block;
    font-size: 0.68rem;
    color: var(--dark-muted, #5B6B85);
    margin-top: 0.15rem;
}

.hd-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1rem 1.25rem 1.25rem;
}

@media (max-width: 720px) {
    .hd-body { grid-template-columns: 1fr; }
    .hd-stats, .hd-stats-5 { grid-template-columns: repeat(2, 1fr); }
}

.hd-section-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--dark, #14213D);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hd-section-title svg { color: var(--dark-muted, #5B6B85); }

.hd-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 130px;
    padding: 0.5rem 0.25rem 0;
    border-bottom: 1px solid var(--border, #D8DEE9);
}

.hd-chart-empty {
    align-items: center;
    justify-content: center;
    color: var(--dark-muted, #5B6B85);
    font-size: 0.8rem;
}

/* Band trend — SVG line chart (Phase 4b) */
.hd-chart-wrap-svg { width: 100%; }

.hd-trend { width: 100%; height: auto; display: block; }

.hd-trend-grid {
    stroke: var(--border, #D8DEE9);
    stroke-width: 1;
}

.hd-trend-ylabel {
    font-size: 9px;
    fill: var(--dark-muted, #5B6B85);
    font-family: var(--font-body, sans-serif);
}

.hd-trend-line {
    fill: none;
    stroke: var(--primary, #14213D);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hd-trend-dot {
    fill: var(--accent, #F0A202);
    stroke: var(--surface, #fff);
    stroke-width: 1.5;
}

/* Section title row with inline selector */
.hd-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hd-section-row > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Weekly goal (Phase 4b) */
.hd-weekgoal-select {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary, #14213D);
    background: var(--surface, #fff);
    border: 1px solid var(--border-strong, #C3CCDB);
    border-radius: 6px;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
}

.hd-weekgoal-progress { margin-top: 0.5rem; }

.hd-weekgoal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dark-muted, #5B6B85);
}

.hd-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 0.25rem;
    min-width: 0;
}

.hd-bar {
    width: 100%;
    max-width: 44px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.hd-bar-band {
    font-size: 0.7rem;
    font-weight: 700;
}

/* 7-day activity strip (Phase 4) */
.hd-activity { margin-top: 0.9rem; }

.hd-act-strip {
    display: flex;
    gap: 0.35rem;
}

.hd-act-cell {
    flex: 1;
    height: 14px;
    border-radius: 3px;
    background: var(--light, #EDF1F7);
    border: 1px solid var(--border, #D8DEE9);
}

.hd-act-cell.has1 { background: #F0A20266; border-color: #F0A20299; }
.hd-act-cell.has2 { background: #F0A20299; border-color: #F0A202; }
.hd-act-cell.has3 { background: #F0A202; border-color: #B7791F; }

.hd-act-meta {
    font-size: 0.72rem;
    color: var(--dark-muted, #5B6B85);
    margin-top: 0.35rem;
    font-weight: 600;
}

.hd-results { min-width: 0; }

.hd-result-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border, #D8DEE9);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--surface, #fff);
}

.hd-result-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.hd-result-info {
    flex: 1;
    min-width: 0;
}

.hd-result-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--dark, #14213D);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-result-meta {
    font-size: 0.72rem;
    color: var(--dark-muted, #5B6B85);
}

.hd-result-band {
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}

.hd-loading,
.hd-empty {
    text-align: center;
    padding: 1.6rem 1.25rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #D8DEE9);
    border-radius: var(--border-radius, 10px);
    color: var(--dark, #14213D);
}

.hd-empty-icon {
    color: var(--dark-muted, #5B6B85);
    margin-bottom: 0.5rem;
}

.hd-empty-icon svg { width: 28px; height: 28px; }

.hd-retry {
    margin-top: 0.6rem;
    background: var(--primary, #14213D);
    color: #fff;
    border: none;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.hd-retry:hover { background: var(--primary-hover, #0D1730); }

/* ===========================
   Grammar Practice Card (Academic Trust restyle — flat navy)
   =========================== */

.grammar-card {
    background: var(--primary, #14213D);
    border-radius: 10px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.grammar-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.grammar-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.grammar-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.grammar-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.grammar-stat {
    background: rgba(255, 255, 255, 0.12);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.grammar-stat strong {
    font-weight: 700;
}

.grammar-btn {
    display: inline-block;
    background: var(--accent, #F0A202);
    color: #14213D;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: filter 0.15s;
}

.grammar-btn:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .grammar-stats {
        gap: 0.5rem;
    }
    .grammar-stat {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}
