body{
    background:#f7f7f7;
}

main{
    flex:1;
    padding:40px 20px 80px;
    max-width:1200px;
    margin:0 auto;
    width:100%;
}

.credit-panel-section{
    margin:70px 0;
    padding:56px 40px 40px;
    background:linear-gradient(135deg, #FFFCF9 0%, #F9F4EE 100%);
    border-radius:24px;
    box-shadow:0 8px 24px rgba(0,0,0,0.05);
    position:relative;
    z-index:2;
}

.credit-panel-header{
    text-align:center;
    max-width:820px;
    margin:0 auto 40px;
}

.credit-label{
    display:inline-block;
    background:rgba(243,111,33,0.10);
    color:#f36f21;
    padding:8px 16px;
    border-radius:999px;
    font-size:0.92rem;
    font-weight:700;
    margin-bottom:14px;
}

.hero-title{
    font-size:3rem;
    color:var(--secondary-color);
    margin-bottom:12px;
    line-height:1.2;
}

.credit-subtitle{
    max-width:760px;
    margin:0 auto;
    color:#666;
    line-height:1.8;
    font-size:1.05rem;
}

.credit-top-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-bottom:24px;
}

.credit-control-box label{
    display:block;
    font-weight:700;
    margin-bottom:8px;
    color:#333;
}

.credit-control-box select,
.credit-control-box input{
    width:100%;
    height:48px;
    padding:0 16px;
    border:1px solid #ddd;
    border-radius:14px;
    font-size:1rem;
    background:#fff;
    outline:none;
    transition:0.25s ease;
}

.credit-control-box select:focus,
.credit-control-box input:focus{
    border-color:#f36f21;
    box-shadow:0 0 0 3px rgba(243,111,33,0.10);
}

.credit-summary-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:16px;
    margin-bottom:20px;
}

.credit-summary-card{
    background:#ffffff;
    border:1px solid rgba(243,111,33,0.12);
    border-radius:18px;
    padding:18px;
    text-align:center;
    box-shadow:0 6px 18px rgba(0,0,0,0.04);
}

.credit-summary-card span{
    display:block;
    color:#666;
    margin-bottom:10px;
    font-size:0.95rem;
}

.credit-summary-card h3{
    margin:0;
    font-size:1.8rem;
    color:#222;
}

.status-card h3{
    font-size:1.35rem;
}

.credit-progress-wrap{
    margin-bottom:22px;
}

.credit-progress-bar{
    width:100%;
    height:14px;
    background:#ececec;
    border-radius:999px;
    overflow:hidden;
}

.credit-progress-fill{
    height:100%;
    width:0%;
    background:linear-gradient(90deg, #f36f21, #f5a14c);
    border-radius:999px;
    transition:width 0.45s ease;
}

.credit-progress-text{
    margin-top:10px;
    font-weight:700;
    color:#444;
    text-align:right;
}

.credit-bulk-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin:22px 0 16px;
}

.bulk-btn{
    border:none;
    background:#ffffff;
    color:#333;
    padding:12px 18px;
    border-radius:12px;
    font-weight:700;
    cursor:pointer;
    transition:all 0.25s ease;
    box-shadow:0 6px 16px rgba(0,0,0,0.04);
}

.bulk-btn:hover{
    transform:translateY(-2px);
    background:#f6f6f6;
}

.bulk-btn-primary{
    background:#f36f21;
    color:#fff;
    box-shadow:0 8px 18px rgba(243,111,33,0.22);
}

.bulk-btn-primary:hover{
    background:#d95f18;
    box-shadow:0 12px 22px rgba(243,111,33,0.30);
}

.drag-layout{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
    margin-top:20px;
}

.drag-column{
    background:#ffffff;
    border:1px solid rgba(243,111,33,0.10);
    border-radius:20px;
    overflow:hidden;
    box-shadow:0 8px 24px rgba(0,0,0,0.04);

    height:520px;   /* ความสูงคงที่ */
    display:flex;
    flex-direction:column;
}

.drag-column-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 20px;
    background:#fffaf5;
    border-bottom:1px solid #f1f1f1;
}

.drag-column-header h3{
    margin:0;
    font-size:1.1rem;
    color:#22334d;
}

.drag-column-header span{
    font-size:0.92rem;
    color:#777;
    font-weight:600;
}

.drop-zone{
    flex:1;
    overflow-y:auto;

    padding:16px;
    background:#ffffff;
}

.selected-zone{
    background:#ffffff;
}

.drop-zone.drag-over{
    background:#fff8f2;
}

.drop-zone-empty{
    display:flex;
    align-items:center;
    justify-content:center;

    height:100%;

    color:#999;
    border:2px dashed #e5e5e5;
    border-radius:16px;
    font-size:1rem;
    padding:20px;
}

.drop-zone::-webkit-scrollbar{
    width:6px;
}

.drop-zone::-webkit-scrollbar-thumb{
    background:#f36f21;
    border-radius:10px;
}

.drop-zone::-webkit-scrollbar-track{
    background:transparent;
}

.course-pill-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.course-pill{
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:12px;
    align-items:center;
    background:#ffffff;
    border:1px solid rgba(243,111,33,0.10);
    border-radius:16px;
    padding:14px 16px;
    cursor:grab;
    transition:all 0.2s ease;
}

.course-pill:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 20px rgba(0,0,0,0.05);
}

.course-pill.dragging{
    opacity:0.5;
}

.course-pill-code{
    font-weight:700;
    color:#2c3e50;
    margin-bottom:4px;
}

.course-pill-name{
    color:#666;
    line-height:1.5;
    font-size:0.95rem;
}

.course-pill-credit{
    font-weight:700;
    color:#f36f21;
    white-space:nowrap;
}

.course-pill-action{
    font-size:0.85rem;
    color:#999;
    white-space:nowrap;
}

/* celebration */
.credit-progress-fill.completed{
    animation:progressCelebrate 0.9s ease;
}

@keyframes progressCelebrate{
    0%{ transform:scaleX(1); filter:brightness(1); }
    25%{ transform:scaleX(1.03); filter:brightness(1.08); }
    50%{ transform:scaleX(1); filter:brightness(1.2); }
    75%{ transform:scaleX(1.02); filter:brightness(1.08); }
    100%{ transform:scaleX(1); filter:brightness(1); }
}

.credit-summary-card.completed-card{
    animation:summaryPop 0.55s ease;
    border-color:rgba(31,157,85,0.22);
    box-shadow:0 10px 22px rgba(31,157,85,0.10);
}

@keyframes summaryPop{
    0%{ transform:scale(1); }
    45%{ transform:scale(1.06); }
    100%{ transform:scale(1); }
}

.celebration-popup{
    position:fixed;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,0.26);
    opacity:0;
    pointer-events:none;
    transition:opacity 0.25s ease;
    z-index:9999;
}

.celebration-popup.show{
    opacity:1;
    pointer-events:auto;
}

.celebration-box{
    background:#fff;
    border-radius:22px;
    padding:28px 26px;
    width:min(90vw, 360px);
    text-align:center;
    box-shadow:0 20px 40px rgba(0,0,0,0.18);
    animation:celebrationBounce 0.55s ease;
}

@keyframes celebrationBounce{
    0%{ transform:scale(0.82); opacity:0; }
    60%{ transform:scale(1.05); opacity:1; }
    100%{ transform:scale(1); opacity:1; }
}

.celebration-emoji{
    font-size:2.4rem;
    margin-bottom:8px;
}

.celebration-box h3{
    margin:0 0 8px;
    color:#1f9d55;
    font-size:1.5rem;
}

.celebration-box p{
    margin:0;
    color:#555;
    line-height:1.6;
}

@media (max-width: 992px){
    .credit-summary-grid{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media (max-width: 900px){
    .drag-layout{
        grid-template-columns:1fr;
    }

    .drag-column{
        min-height:auto;
    }

    .drop-zone{
        min-height:320px;
    }

    .drop-zone-empty{
        min-height:260px;
    }
}

@media (max-width: 768px){
    main{
        padding:30px 16px 60px;
    }

    .credit-panel-section{
        padding:40px 20px;
        border-radius:20px;
    }

    .hero-title{
        font-size:2rem;
    }

    .credit-subtitle{
        font-size:1rem;
    }

    .credit-top-controls{
        grid-template-columns:1fr;
    }

    .credit-summary-grid{
        grid-template-columns:1fr;
    }

    .credit-bulk-actions{
        flex-direction:column;
    }

    .bulk-btn{
        width:100%;
    }
}