:root {
    --dash-bg-top: #ffffff;
    --dash-bg-bottom: #f6f8ff;
    --dash-ink: #052143;
    --dash-muted: #6b778b;
    --dash-line: #d1e3fb;
    --dash-cyan: #00c0e8;
    --dash-indigo: #6155f5;
    --dash-orange: #ff8d28;
    --dash-red: #ff383c;
}

body {
    background: linear-gradient(180deg, var(--dash-bg-top) 0%, var(--dash-bg-bottom) 18%, var(--dash-bg-bottom) 100%);
}

.dashboard-shell {
    max-width: 1480px;
    margin: 0 auto;
    padding: 88px 16px 64px;
    font-family: "Outfit", "Sarabun", sans-serif;
}

.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3,
.dashboard-shell p,
.dashboard-shell a,
.dashboard-shell span,
.dashboard-shell button,
.dashboard-shell li,
.dashboard-shell strong,
.dashboard-shell small,
.dashboard-shell b {
    font-family: "Outfit", "Sarabun", sans-serif;
}

.home-hero {
    margin-bottom: 14px;
}

.home-hero h1 {
    font-size: clamp(34px, 3.1vw, 54px);
    line-height: 1.02;
    color: var(--dash-ink);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.home-hero p {
    color: var(--dash-muted);
    font-size: clamp(15px, 1.3vw, 20px);
}

.dashboard-grid {
    --dash-gap: clamp(14px, 1.2vw, 28px);
    display: grid;
    grid-template-columns:
        calc((100% - var(--dash-gap)) / 2)
        calc((100% - (3 * var(--dash-gap))) / 4)
        calc((100% - (3 * var(--dash-gap))) / 4);
    grid-template-areas:
        "continue upcoming schedule"
        "mycourses leaderboard leaderboard";
    gap: var(--dash-gap);
    align-items: start;
}

.dash-card {
    background: #fff;
    border: 1px solid var(--dash-line);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(9, 30, 66, .08);
}

.dash-card h2 {
    color: var(--dash-ink);
    font-size: 24px;
    line-height: 1;
    margin-bottom: 16px;
}

.continue-card {
    grid-area: continue;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    height: 352px;
    min-height: 352px;
    padding: 32px;
    position: relative;
    box-shadow: none;
}

.continue-card h2 {
    margin-bottom: 0;
}

.continue-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
}

.continue-body {
    height: 236px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.continue-thumbnail {
    width: 320px;
    height: 236px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #687eff;
    position: relative;
    min-height: 236px;
    flex: 0 0 320px;
}

.continue-thumbnail img {
    width: 100%;
    height: 236px;
    object-fit: cover;
    display: block;
}

.continue-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    background: #e5e5ea;
}

.continue-progress > span {
    display: block;
    width: 0%;
    height: 100%;
    background: #687eff;
    transition: width .3s ease;
}

.eyebrow {
    color: var(--dash-muted);
    font-size: 15px;
    margin: 0 0 8px;
}

.continue-body h3 {
    color: var(--dash-ink);
    font-size: clamp(24px, 2vw, 44px);
    line-height: 1.2;
    margin: 0 0 10px;
    font-weight: 500;
    letter-spacing: -0.02em;
    display: block;
    overflow: visible;
}

.continue-rating {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.star {
    width: 18px;
    height: 18px;
    display: inline-block;
    background: #6b778b;
    -webkit-mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m12 17.27-6.18 3.73 1.64-7.03L2 9.24l7.19-.61L12 2l2.81 6.63 7.19.61-5.46 4.73L18.18 21z'/></svg>");
    mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m12 17.27-6.18 3.73 1.64-7.03L2 9.24l7.19-.61L12 2l2.81 6.63 7.19.61-5.46 4.73L18.18 21z'/></svg>");
}

.star.filled {
    background: #ffc224;
}

.rating-text {
    color: #6b778b;
    font-size: 16px;
    line-height: 1.2;
}

.continue-meta-row {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #052143;
    margin-bottom: 10px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.meta-item em {
    font-style: italic;
    font-size: 16px;
    line-height: 1.2;
}

.meta-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
    background: #687eff;
}

.meta-icon.level {
    background: #ff3ea5;
    -webkit-mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'><path d='M1.5 9a1.5 1.5 0 0 1 3 0v6a1.5 1.5 0 1 1-3 0V9Zm6-6a1.5 1.5 0 0 1 3 0v12a1.5 1.5 0 1 1-3 0V3Zm6 3a1.5 1.5 0 0 1 3 0v9a1.5 1.5 0 1 1-3 0V6Z'/></svg>");
    mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'><path d='M1.5 9a1.5 1.5 0 0 1 3 0v6a1.5 1.5 0 1 1-3 0V9Zm6-6a1.5 1.5 0 0 1 3 0v12a1.5 1.5 0 1 1-3 0V3Zm6 3a1.5 1.5 0 0 1 3 0v9a1.5 1.5 0 1 1-3 0V6Z'/></svg>");
}

.meta-icon.lessons {
    background: #ffc224;
    -webkit-mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2.8 1.82L12 19.5l5.2 2.32A2 2 0 0 0 20 20V4a2 2 0 0 0-2-2H6Zm2 4h8a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Zm0 4h8a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Z'/></svg>");
    mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2.8 1.82L12 19.5l5.2 2.32A2 2 0 0 0 20 20V4a2 2 0 0 0-2-2H6Zm2 4h8a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Zm0 4h8a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Z'/></svg>");
}

.meta-icon.time {
    background: #687eff;
    -webkit-mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1a11 11 0 1 0 11 11A11 11 0 0 0 12 1Zm0 2a9 9 0 1 1-9 9 9 9 0 0 1 9-9Zm-1 4a1 1 0 0 1 2 0v4.586l2.707 2.707a1 1 0 1 1-1.414 1.414l-3-3A1 1 0 0 1 11 12Z'/></svg>");
    mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1a11 11 0 1 0 11 11A11 11 0 0 0 12 1Zm0 2a9 9 0 1 1-9 9 9 9 0 0 1 9-9Zm-1 4a1 1 0 0 1 2 0v4.586l2.707 2.707a1 1 0 1 1-1.414 1.414l-3-3A1 1 0 0 1 11 12Z'/></svg>");
}

.continue-divider {
    border-top: 1px dashed #d1e3fb;
    width: 100%;
    margin-bottom: 10px;
}

.continue-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    width: 100%;
}

.continue-go {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    padding: 0;
    color: #fff;
    cursor: pointer;
}

.continue-go-text {
    width: 130px;
    height: 48px;
    margin-right: -10px;
    border-radius: 100px;
    background: #008dd0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.continue-go-text::after {
    content: "";
    position: absolute;
    width: 121px;
    height: 31px;
    left: 50%;
    top: 50%;
    background: #ffffff;
    opacity: 0.1;
    transform: translate(-50%, -50%) rotate(35deg);
}

.continue-go-icon {
    width: 48px;
    height: 48px;
    border-radius: 100px;
    background: #008dd0;
    border: 1px solid #ffffff;
    position: relative;
}

.continue-go-icon::before {
    content: "";
    width: 14px;
    height: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    -webkit-mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'><path d='M96 96l128 160L96 416' fill='none' stroke='black' stroke-width='48' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    mask: no-repeat center/100% 100% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'><path d='M96 96l128 160L96 416' fill='none' stroke='black' stroke-width='48' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.continue-go:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.upcoming-card {
    grid-area: upcoming;
    height: 352px;
    min-height: 352px;
}

.upcoming-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 230px;
    overflow: auto;
    padding-right: 6px;
}

.upcoming-list li {
    color: var(--dash-ink);
    line-height: 1.5;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.dot.red { background: var(--dash-red); }
.dot.orange { background: var(--dash-orange); }
.dot.cyan { background: var(--dash-cyan); }

.schedule-card {
    grid-area: schedule;
    height: 352px;
    min-height: 352px;
    display: flex;
    flex-direction: column;
}

.schedule-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.schedule-head span {
    color: var(--dash-ink);
    font-size: 14px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px 6px;
    height: 100%;
    align-content: space-between;
    padding-bottom: 2px;
}

.calendar-grid > span {
    text-align: center;
    color: var(--dash-muted);
    font-size: 13px;
}

.calendar-grid .day {
    color: var(--dash-ink);
    font-weight: 500;
}

.calendar-grid .day.muted {
    color: #9da9bc;
}

.calendar-grid .day.is-active {
    background: #687eff;
    color: #fff;
    border-radius: 8px;
}

.calendar-grid .day.dot-red,
.calendar-grid .day.dot-orange,
.calendar-grid .day.dot-cyan {
    position: relative;
}

.calendar-grid .day.dot-red::after,
.calendar-grid .day.dot-orange::after,
.calendar-grid .day.dot-cyan::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.calendar-grid .day.dot-red::after {
    background: #ff383c;
}

.calendar-grid .day.dot-orange::after {
    background: #ff8d28;
}

.calendar-grid .day.dot-cyan::after {
    background: #00c0e8;
}

.mycourses-card {
    grid-area: mycourses;
    width: auto;
    height: 372px;
    min-height: 372px;
    max-height: none;
    padding: 32px;
    overflow: hidden;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-head a {
    color: #0088ff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.course-chart {
    --label-w: 110px;
    --value-w: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
    padding: 4px 0 0;
}

.chart-row {
    display: grid;
    grid-template-columns: var(--label-w) minmax(0, 1fr) var(--value-w);
    align-items: center;
    gap: 16px;
    min-height: 34px;
}

.chart-row span {
    color: var(--dash-ink);
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
}

.bar-track {
    height: 36px;
    background: #eceef3;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.bar {
    height: 36px;
    width: 0%;
    border-radius: 999px;
    transition: width .35s ease;
}

.bar.completed { background: rgba(97, 85, 245, .9); }
.bar.learning { background: rgba(0, 192, 232, .8); }
.bar.not-started { background: rgba(255, 141, 40, .85); }
.bar.expired { background: rgba(255, 56, 60, .75); }

.chart-row strong {
    color: var(--dash-ink);
    font-size: 16px;
    line-height: 1;
    text-align: right;
    padding-left: 0;
}

.leaderboard-card {
    grid-area: leaderboard;
    height: 372px;
    min-height: 372px;
}

.leaderboard-wrap {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 24px;
    align-items: center;
}

.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.podium-item {
    border-radius: 16px 16px 0 0;
    text-align: center;
    padding: 16px 8px 10px;
    color: var(--dash-ink);
}

.podium-item span {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.podium-item small {
    font-size: 12px;
    color: var(--dash-muted);
}

.podium-item.first { background: #ffebc2; min-height: 190px; }
.podium-item.second { background: #efefef; min-height: 150px; }
.podium-item.third { background: #dfd0cc; min-height: 120px; }

.leaderboard-list {
    list-style: none;
    display: grid;
    gap: 10px;
}

.leaderboard-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
    color: var(--dash-ink);
}

.leaderboard-list li span {
    color: var(--dash-muted);
    font-size: 12px;
    white-space: nowrap;
}

.axis-row {
    display: none;
}

.instructor-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.instructor-mini.is-inline {
    margin-left: auto;
    margin-top: 0;
    width: fit-content;
}

.instructor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid #687eff;
    object-fit: cover;
}

.instructor-text {
    display: grid;
    gap: 2px;
}

.instructor-text strong {
    font-size: 14px;
    color: var(--dash-ink);
    font-weight: 500;
}


@media (min-width: 1680px) {
    .dashboard-shell {
        max-width: 1760px;
        padding: 92px 18px 68px;
    }

    .dashboard-grid {
        grid-template-columns: 852px 391px 429px;
        gap: 32px;
    }

    .continue-card {
        width: 852px;
        max-width: 852px;
        height: 352px;
        min-height: 352px;
    }

    .mycourses-card {
        width: 852px;
        height: 372px;
        min-height: 372px;
    }

    .course-chart {
        --label-w: 164px;
        --plot-w: 560px;
    }
}

@media (max-width: 1679px) {
    .continue-actions {
        flex-wrap: nowrap;
        row-gap: 0;
    }
}

@media (max-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-areas: none;
        gap: 20px;
    }

    .dash-card {
        padding: 24px 26px;
    }

    .dash-card h2 {
        font-size: 24px;
        margin-bottom: 14px;
    }

    .continue-card,
    .upcoming-card,
    .schedule-card,
    .mycourses-card,
    .leaderboard-card {
        grid-area: auto;
        min-height: unset;
        width: auto;
        height: auto;
        max-height: none;
        grid-column: span 12;
    }

    .continue-content {
        flex-direction: column;
        gap: 18px;
    }

    .continue-body {
        height: auto;
    }

    .continue-thumbnail {
        width: 100%;
        flex-basis: auto;
    }

    .continue-thumbnail img {
        height: 280px;
    }

    .continue-body h3 {
        font-size: 36px;
    }

    .rating-text,
    .meta-item em {
        font-size: 16px;
    }

    .continue-go-text {
        width: 130px;
        height: 48px;
        font-size: 16px;
    }

    .continue-go-icon {
        width: 48px;
        height: 48px;
    }

    .instructor-mini.is-inline {
        margin-left: 0;
        margin-top: 14px;
    }

    .instructor-avatar {
        width: 56px;
        height: 56px;
    }

    .instructor-text strong {
        font-size: 18px;
    }

    .leaderboard-wrap {
        grid-template-columns: 1fr;
    }

    .chart-row span {
        font-size: 22px;
    }

    .chart-row strong {
        font-size: 24px;
    }

    .course-chart {
        --label-w: 110px;
        --plot-w: calc(100% - 110px - 34px);
    }

    .course-chart::before,
    .course-chart::after {
        height: 220px;
    }

    .bar-track,
    .bar {
        height: 34px;
    }
}

@media (max-width: 780px) {
    .dashboard-shell {
        padding: 86px 14px 54px;
    }

    .home-hero h1 {
        font-size: 34px;
    }

    .home-hero p {
        font-size: 16px;
    }

    .dash-card h2 {
        font-size: 26px;
    }

    .continue-body h3 {
        font-size: 28px;
    }

    .upcoming-list li,
    .chart-row span,
    .leaderboard-list li {
        font-size: 18px;
    }

    .chart-row {
        grid-template-columns: 110px 1fr 30px;
        gap: 10px;
    }

    .chart-row strong {
        font-size: 22px;
    }

    .leaderboard-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}
