/* =======================
   Course Categories Page
======================= */

.course-page{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:hidden;
    box-sizing:border-box;
}


.course-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:25px;
}

.course-card{
    position:relative;
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 3px 12px rgba(0,0,0,.08);
    transition:.25s;

    display:flex;
    flex-direction:column;
    height:520px;
}

.course-card:hover{
    transform:translateY(-3px);
    box-shadow:0 8px 24px rgba(0,0,0,.12);
}

.course-admin{
    position:absolute;
    top:15px;
    right:15px;
    display:flex;
    gap:8px;
}


.course-link{
    color:#222;
    text-decoration:none;
    transition:.2s;
}

.course-link:hover{
    color:blue;
}

.course-desc{
    padding:0 22px 20px;
    font-size:18px;
}

.course-desc p{
    margin:0;
    color:#555;
    line-height:1.6;
    text-align: justify;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
}
.course-image{
    width:100%;
    height:220px;
    overflow:hidden;
}

.course-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.no-course{
    grid-column:1/-1;
    text-align:center;
    padding:60px 20px;
    background:#fff;
    border-radius:12px;
    box-shadow:0 3px 12px rgba(0,0,0,.08);
}

.no-course-icon{
    font-size:60px;
    margin-bottom:15px;
}

.no-course h3{
    margin-bottom:10px;
    font-size:28px;
}

.no-course p{
    color:#666;
    font-size:18px;
}

/* =======================
      Responsive
======================= */

@media(max-width:768px){

    .course-header{
        flex-direction:column;
        align-items:stretch;
    }

    .course-grid{
        grid-template-columns:1fr;
    }

    .course-image{
    height:180px;
}
    .course-title{
        font-size:20px;
    }

}



.category-course-page{

    max-width:900px;
    margin:40px auto;

}

.category-course-form{

    background:#fff;
    border-radius:16px;
    padding:30px;
    box-shadow:0 8px 30px rgba(0,0,0,.08);

}

.category-course-form-group{

    display:flex;
    flex-direction:column;
    margin-bottom:22px;

}

.category-course-form-group label{

    font-weight:600;
    margin-bottom:8px;
    color:#333;

}

.category-course-form-group input[type=text],
.category-course-form-group input[type=number],
.category-course-form-group input[type=file],
.category-course-form-group textarea{

    width:100%;
    border:1px solid #d8d8d8;
    border-radius:10px;
    padding:12px;
    font-size:15px;
    transition:.2s;

}

.category-course-form-group input:focus,
.category-course-form-group textarea:focus{

    border-color:#0d6efd;
    outline:none;
    box-shadow:0 0 0 3px rgba(13,110,253,.15);

}

.category-course-actions{

    display:flex;
    gap:15px;
    flex-wrap:wrap;
    margin-top:25px;

}

@media(max-width:768px){

.category-course-form{

    padding:20px;

}

.category-course-actions{

    flex-direction:column;

}

.category-course-actions .btn{

    width:100%;
    text-align:center;

}

}




.category-course-image-preview{

    margin:20px 0;

}

.category-course-image-preview img{

    width:260px;
    max-width:100%;
    border-radius:12px;
    display:block;
    box-shadow:0 4px 14px rgba(0,0,0,.15);

}

.category-course-delete-image{

    display:inline-flex;
    align-items:center;
    gap:10px;
    margin-bottom:20px;
    cursor:pointer;
    font-size:16px;

}

.category-course-delete-image input{

    width:18px;
    height:18px;

}


.form-message{

    padding:15px 20px;
    border-radius:10px;
    margin-bottom:25px;
    font-size:17px;
    font-weight:600;

}

.form-message.success{

    background:#d4edda;
    color:#155724;
    border:1px solid #c3e6cb;

}

.form-message.error{

    background:#f8d7da;
    color:#721c24;
    border:1px solid #f5c6cb;

}




/* ==========================
        View Course Category
========================== */

.course-view-page{
    padding:40px 0;
}

.course-view-category-description{
    margin:15px 0 35px;
    font-size:18px;
    color:#555;
    line-height:1.7;
}

.course-view-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(360px,1fr));
    gap:28px;
}

.course-view-card{
    position:relative;

    display:flex;
    flex-direction:column;
    background:#fff;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
    transition:.25s;
    height:100%;
}

.course-view-card .course-admin{

    position:absolute;
    top:15px;
    right:15px;

    display:flex;
    gap:8px;

    z-index:20;

}
.course-view-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 24px rgba(0,0,0,.14);
}

.course-view-image{
    width:100%;
    height:220px;
    overflow:hidden;
    background:#f2f2f2;
}

.course-view-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.course-view-body{
    display:flex;
    flex-direction:column;
    flex:1;
    padding:22px;
}

.course-view-title{
    margin:0 0 15px;
    font-size:24px;
    line-height:1.35;
}

.course-view-title a{
    color:#222;
    text-decoration:none;
    transition:.2s;
}

.course-view-title a:hover{
    color:#0d6efd;
}

.course-view-description{
    color:#555;
    font-size:17px;
    line-height:1.6;
    margin-bottom:22px;
}

.course-view-info{
    margin-bottom:18px;
}

.course-view-info strong{
    display:block;
    margin-bottom:10px;
    font-size:18px;
}

.course-view-teachers{
    margin:0;
    padding-left:22px;
}

.course-view-teachers li{
    margin-bottom:6px;
    line-height:1.5;
    font-size:18px;
}

.course-view-registration{
    margin-top:auto;
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:20px;
}

.course-view-open,
.course-view-closed,
.course-view-key{
    padding:10px 14px;
    border-radius:8px;
    font-weight:600;
    font-size:15px;
}

.course-view-open{
    background:#d4edda;
    color:#155724;
}

.course-view-closed{
    background:#fdecea;
    color:#b71c1c;
}

.course-view-key{
    background:#fff3cd;
    color:#856404;
}

.course-view-footer{
    margin-top:auto;
    padding-top:18px;
    border-top:1px solid #e5e5e5;
    font-size:16px;
    font-weight:600;
    color:#444;
}

.course-view-footer::before{
    margin-right:6px;
}

.no-course{
    grid-column:1/-1;
    background:#fff;
    border-radius:14px;
    text-align:center;
    padding:60px 20px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.no-course-icon{
    font-size:60px;
    margin-bottom:15px;
}

.no-course h3{
    margin:0 0 12px;
    font-size:30px;
}

.no-course p{
    margin:0;
    color:#666;
    font-size:18px;
}


.course-view-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:25px;
}

/* ==========================
        Responsive
========================== */

@media(max-width:900px){

    .course-view-grid{
        grid-template-columns:1fr;
    }

}

@media(max-width:600px){

    .course-view-image{
        height:190px;
    }

    .course-view-body{
        padding:18px;
    }

    .course-view-title{
        font-size:22px;
    }

    .course-view-description{
        font-size:18px;
    }

    .course-view-category-description{
        font-size:17px;
    }

}


/* ===========================
          Add Course
=========================== */

.add-course-page{
    max-width:950px;
    margin:40px auto;
}

.add-course-form{
    background:#fff;
    border-radius:16px;
    padding:30px;
    box-shadow:0 8px 30px rgba(0,0,0,.08);
}

.add-course-group{
    display:flex;
    flex-direction:column;
    margin-bottom:22px;
}

.add-course-group label{
    font-weight:600;
    margin-bottom:8px;
    color:#333;
}

.add-course-group input[type=text],
.add-course-group input[type=file],
.add-course-group select,
.add-course-group textarea{
    width:100%;
    padding:12px;
    font-size:16px;
    border:1px solid #d8d8d8;
    border-radius:10px;
    transition:.2s;
    background:#fff;
    box-sizing:border-box;
}

.add-course-group input:focus,
.add-course-group textarea:focus,
.add-course-group select:focus{
    outline:none;
    border-color:#0d6efd;
    box-shadow:0 0 0 3px rgba(13,110,253,.15);
}

.add-course-group small{
    margin-top:6px;
    color:#777;
    font-size:14px;
}

.add-course-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.add-course-checkbox{
    margin-bottom:25px;
}

.add-course-checkbox label{
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    font-weight:600;
}

.add-course-checkbox input{
    width:18px;
    height:18px;
}

.add-course-actions{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    margin-top:30px;
}

.add-course-actions .btn{
    min-width:180px;
    text-align:center;
}

/* ---------- CKEditor ---------- */

.add-course-form .ck-editor__editable{
    min-height:250px;
}

/* ---------- Flatpickr ---------- */

.flatpickr-input{
    background:#fff !important;
    cursor:pointer;
}

/* ---------- Responsive ---------- */

@media(max-width:768px){

    .add-course-form{
        padding:20px;
    }

    .add-course-row{
        grid-template-columns:1fr;
        gap:0;
    }

    .add-course-actions{
        flex-direction:column;
    }

    .add-course-actions .btn{
        width:100%;
    }

}

.teacher-row{

    display:flex;
    gap:10px;
    margin-bottom:10px;

}

.teacher-row select{

    flex:1;

}

.add-teacher-btn{

    margin-top:10px;
    padding:10px 18px;
    border:none;
    border-radius:8px;
    background:#198754;
    color:#fff;
    cursor:pointer;
    transition:.2s;

}

.add-teacher-btn:hover{

    background:#157347;

}

.remove-teacher{

    width:42px;
    border:none;
    border-radius:8px;
    background:#dc3545;
    color:#fff;
    cursor:pointer;
    font-size:18px;

}

.remove-teacher:hover{

    background:#bb2d3b;

}


/* ==========================================
                VIEW COURSE
========================================== */

.course-page{
    padding:40px 0 60px;
}

.course-header{
display:flex;
    flex-direction:column;
    gap:18px;
    margin-bottom:30px;
}

.course-breadcrumbs{
    margin-bottom:15px;
    color:#666;
    font-size:15px;
}

.course-breadcrumbs a{
    color:#0d6efd;
    text-decoration:none;
}

.course-breadcrumbs a:hover{
    text-decoration:underline;
}

.course-title{
    font-size:38px;
    margin:0 0 18px;
    line-height:1.3;
    padding:18px 22px 8px;
    font-weight:700;
    line-height:1.35;
    text-align:left;
}

.course-description{
    font-size:18px;
    color:#555;
    line-height:1.8;
}

/* ---------- панель керування ---------- */

.course-actions{

    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-bottom:25px;
    flex-wrap:wrap;

}

.course-action-btn{

    display:inline-flex;
    align-items:center;
    gap:8px;

    padding:11px 18px;

    border-radius:10px;

    background:#0d6efd;
    color:#fff;

    text-decoration:none;
    font-weight:600;

    transition:.2s;

}

.course-action-btn:hover{

    background:#0b5ed7;

}

/* ---------- вкладки ---------- */

.course-tabs{

    display:flex;
    gap:10px;

    margin:35px 0;

    flex-wrap:wrap;

    border-bottom:2px solid #ececec;

}

.course-tab{

    padding:14px 22px;

    color:#444;
    text-decoration:none;

    border-radius:12px 12px 0 0;

    transition:.2s;

    font-weight:600;

}

.course-tab:hover{

    background:#f5f5f5;

}

.course-tab.active{

    background:#0d6efd;
    color:#fff;

}

/* ---------- дві колонки ---------- */

.course-layout{

    display:grid;
    grid-template-columns:1fr 330px;
    gap:30px;

    align-items:start;

}

/* ---------- ліва ---------- */

.course-main{

    display:flex;
    flex-direction:column;
    gap:25px;

}

.course-section{

    background:#fff;
    border-radius:14px;
    padding:30px;

    box-shadow:0 5px 18px rgba(0,0,0,.08);

}

.course-section-header{

    display:flex;
    justify-content:space-between;
    align-items:center;

    gap:20px;

    margin-bottom:25px;

}

.course-section-header h2{

    margin:0;
    font-size:28px;

}

.empty-course{

    text-align:center;
    padding:70px 20px;

}

.empty-course-icon{

    font-size:70px;
    margin-bottom:20px;

}

.empty-course h3{

    margin-bottom:12px;
    font-size:30px;

}

.empty-course p{

    max-width:600px;
    margin:auto;

    color:#666;
    line-height:1.8;
    font-size:18px;

}

/* ---------- права ---------- */

.course-sidebar{

    display:flex;
    flex-direction:column;
    gap:25px;

    position:sticky;
    top:25px;

}

.course-info-card{

    background:#fff;
    border-radius:14px;

    padding:22px;

    box-shadow:0 5px 18px rgba(0,0,0,.08);

}

.course-info-card h3{

    margin:0 0 18px;
    font-size:22px;

}

.course-info-table{

    width:100%;
    border-collapse:collapse;

}

.course-info-table td{

    padding:10px 0;
    border-bottom:1px solid #ececec;

    vertical-align:top;

}

.course-info-table td:first-child{

    font-weight:600;
    color:#555;
    width:45%;

}

.course-sidebar-teachers{

    margin:0;
    padding-left:22px;

}

.course-sidebar-teachers li{

    margin-bottom:8px;
    line-height:1.6;

}

/* ---------- Responsive ---------- */

@media(max-width:1100px){

    .course-layout{

        grid-template-columns:1fr;

    }

    .course-sidebar{

        position:static;

    }

}

@media(max-width:768px){

    .course-title{

        font-size:30px;

    }

    .course-tabs{

        flex-direction:column;
        border:none;

    }

    .course-tab{

        border-radius:10px;

    }

    .course-actions{

        justify-content:flex-start;

    }

    .course-section{

        padding:22px;

    }

    .course-section-header{

        flex-direction:column;
        align-items:flex-start;

    }

}


/* =====================================
        VIEWSECTIONS ONLY
===================================== */

.viewsections-page{

    width:100%;
    overflow-x:hidden;

}

/* дві колонки */

.viewsections-page .course-layout{

    display:grid;
    grid-template-columns:minmax(0,1fr) 320px;
    gap:30px;
    align-items:start;

}

/* щоб ліва колонка могла стискатися */

.viewsections-page .course-main{

    min-width:0;

}

/* права колонка */

.viewsections-page .course-sidebar{

    width:100%;
    min-width:0;

}

/* картка діяльності */

.viewsections-module{

    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;

}

/* текст */

.viewsections-module-info{

    flex:1;
    min-width:0;

    padding-right: 60px;

}

/* довгі заголовки */

.viewsections-module-info .section-module-name{

    display:block;

    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;

    line-height:1.45;

}

/* кнопки */

.viewsections-module-admin{

    position:absolute;

    display:flex;
    flex-shrink:0;

    gap:8px;

    align-self:flex-start;

    margin-left:15px;

}

/* адаптив */

@media(max-width:1100px){

    .viewsections-page .course-layout{

        grid-template-columns:1fr;

    }

}

@media(max-width:900px){

    .viewsections-module{

        flex-direction:column;

    }

    .viewsections-module-admin{

        margin-left:0;
        margin-top:12px;

    }

}


/* ===========================
      Course Registration
=========================== */

.course-registration-page{

    padding:60px 0;

}

.course-registration-card{

    max-width:700px;
    margin:0 auto;

    background:#fff;

    border-radius:16px;

    padding:40px;

    box-shadow:0 8px 30px rgba(0,0,0,.08);

}

.course-registration-card h1{

    margin:0 0 25px;
    font-size:34px;

}

.course-registration-text{

    font-size:18px;
    color:#555;
    margin-bottom:25px;

}

.course-registration-group{

    display:flex;
    flex-direction:column;

    margin-bottom:25px;

}

.course-registration-group label{

    margin-bottom:8px;
    font-weight:600;

}

.course-registration-group input{

    padding:13px 15px;

    border:1px solid #d7d7d7;

    border-radius:10px;

    font-size:16px;

    transition:.2s;

}

.course-registration-group input:focus{

    outline:none;

    border-color:#0d6efd;

    box-shadow:0 0 0 3px rgba(13,110,253,.15);

}

.course-registration-actions{

    display:flex;
    gap:15px;
    flex-wrap:wrap;

    margin-top:20px;

}

.course-registration-actions .btn{

    min-width:240px;
    text-align:center;

}

.course-registration-info{

    padding:16px 20px;

    border-radius:10px;

    margin-bottom:20px;

    font-size:17px;

    font-weight:600;

}

.course-registration-info.success{

    background:#d4edda;
    color:#155724;
    border:1px solid #c3e6cb;

}

.course-registration-info.warning{

    background:#fff3cd;
    color:#856404;
    border:1px solid #ffe69c;

}

/* ---------- Responsive ---------- */

@media(max-width:768px){

.course-registration-card{

    padding:25px;

}

.course-registration-card h1{

    font-size:28px;

}

.course-registration-actions{

    flex-direction:column;

}

.course-registration-actions .btn{

    width:100%;

}

}

.course-registration-info.error{
    background:#fdeaea;
    border:1px solid #f5b5b5;
    color:#a11d2a;
}





/* ==========================
   Gradebook
========================== */

.gradebook-page{
    padding:30px 0;
}

.gradebook-page h1{
    margin-bottom:25px;
}

.gradebook-section{
    margin-bottom:35px;
}

.gradebook-section h2{
    margin-bottom:12px;
}

.gradebook-table-wrapper{
    width:100%;
    overflow-x:auto;
}

.gradebook-table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 3px 10px rgba(0,0,0,.08);
}

.gradebook-table th{
    background:#f5f5f5;
    padding:12px;
    text-align:center;
    border:1px solid #ddd;
    white-space:nowrap;
}

.gradebook-table td{
    padding:10px;
    border:1px solid #ddd;
    vertical-align:top;
}

.gradebook-table tbody tr:nth-child(even){
    background:#fafafa;
}

.gradebook-table tbody tr:hover{
    background:#f0f7ff;
}

.gradebook-topic-total{
    background:#eef6ff !important;
    font-weight:600;
}

.gradebook-course-total{
    margin-top:35px;
}

.gradebook-course-total table{
    max-width:500px;
}

.gradebook-course-total td{
    font-size:17px;
}

.gradebook-table strong{
    color:#0d47a1;
}


.gradebook-item{
    margin-bottom:10px;
    padding-bottom:8px;
    border-bottom:1px dashed #ddd;
}

.gradebook-item:last-child{
    margin-bottom:0;
    padding-bottom:0;
    border-bottom:none;
}

.gradebook-item-name{
    font-weight:600;
    margin-bottom:4px;
}

.gradebook-item-grade{
    color:#0d47a1;
    font-weight:600;
}

.gradebook-item-comment{
    display:block;
    margin-top:3px;
    color:#666;
    font-size:13px;
}

.gradebook-rank{
    font-weight:700;
    color:#d32f2f;
    text-align:center;
}

.gradebook-percent{
    font-weight:700;
    color:#2e7d32;
}

.gradebook-empty{
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    padding:40px;
    text-align:center;
    font-size:18px;
    color:#666;
    margin:25px 0;
}


/* ==========================================================
   Учасники курсу
========================================================== */

.participants-page{
    padding:30px 0 50px;
}

.participants-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    margin:30px 0 20px;
    flex-wrap:wrap;
}

.participants-header h2{
    margin:0;
    font-size:26px;
    color:#222;
}

.participants-enroll-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:11px 18px;
    border-radius:8px;
    background:#0d6efd;
    color:#fff;
    text-decoration:none;
    font-weight:600;
    transition:.2s;
    font-size:18px;
}

.participants-enroll-btn:hover{
    background:#0b5ed7;
    color:#fff;
}

.participants-table-wrapper{
    overflow-x:auto;
    background:#fff;
    border-radius:12px;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.participants-table{
    width:100%;
    min-width:950px;
    border-collapse:collapse;
}

.participants-table thead th{
    padding:16px 18px;
    background:#f5f7fb;
    border-bottom:2px solid #e5e5e5;
    text-align:left;
    font-size:15px;
    font-weight:700;
    color:#333;
}

.participants-table tbody td{
    padding:15px 18px;
    border-bottom:1px solid #ededed;
    vertical-align:middle;
}

.participants-table tbody tr:last-child td{
    border-bottom:none;
}

.participants-table tbody tr:hover{
    background:#fafcff;
}

.participants-table tbody td:first-child{
    text-align:center;
    width:70px;
    font-weight:600;
}

.participants-table tbody td:nth-child(3),
.participants-table tbody td:nth-child(4),
.participants-table tbody td:nth-child(5){
    white-space:nowrap;
}

.participants-table strong{
    color:#222;
    font-weight:600;
}

/* ==========================================================
   Порожній список
========================================================== */

.participants-empty{
    background:#fff;
    border-radius:12px;
    padding:70px 20px;
    text-align:center;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.participants-empty-icon{
    font-size:64px;
    margin-bottom:20px;
}

.participants-empty h3{
    margin:0 0 12px;
    font-size:26px;
    color:#222;
}

.participants-empty p{
    margin:0;
    color:#777;
    font-size:16px;
}

/* ==========================================================
   Адаптивність
========================================================== */

@media(max-width:900px){

    .participants-header{
        flex-direction:column;
        align-items:flex-start;
    }

    .participants-enroll-btn{
        width:100%;
    }

}

@media(max-width:700px){

    .participants-page{
        padding:20px 0 35px;
    }

    .participants-header h2{
        font-size:22px;
    }

    .participants-empty{
        padding:50px 15px;
    }

    .participants-empty-icon{
        font-size:52px;
    }

    .participants-empty h3{
        font-size:22px;
    }

}

.participants-search{
    margin-bottom:20px;
}

.participants-search input{
    width:100%;
    max-width:420px;
    padding:12px 16px;
    border:1px solid #d8d8d8;
    border-radius:8px;
    font-size:15px;
    transition:.2s;
}

.participants-search input:focus{
    outline:none;
    border-color:#0d6efd;
    box-shadow:0 0 0 3px rgba(13,110,253,.15);
}

.course-activities-card{
    margin-top:20px;
}

.course-activities-list{
    list-style:none;
    margin:0;
    padding:0;
}

.course-activities-list li{
    display:flex;
    align-items:center;
    gap:12px;

    padding:12px 14px;
    margin-bottom:10px;

    border:1px solid #e5e7eb;
    border-radius:10px;

    background:#f8fafc;

    transition:.2s;
    cursor:pointer;
}

.course-activities-list li:hover{
    background:#eef5ff;
    border-color:#4a90e2;
    transform:translateX(3px);
}

.activity-icon{
    width:28px;
    text-align:center;
    font-size:20px;
}

.course-activities-list span:last-child{
    font-weight:600;
    color:#2c3e50;
}

.course-sidebar-sticky{
    position:sticky;
    top:20px;
}

.course-activity-link{

    display:flex;
    align-items:center;
    gap:12px;

    width:100%;

    text-decoration:none;
    color:inherit;

}

.course-activity-link:hover{

    color:inherit;

}

/* .tests-table-wrapper{
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 4px 18px rgba(0,0,0,.08);
    margin-top:25px;
} */

/* .tests-table{
    width:100%;
    border-collapse:collapse;
}

.tests-table th{
    background:#f5f7fb;
    padding:16px;
    text-align:left;
    font-size:15px;
    font-weight:700;
    border-bottom:2px solid #e5e7eb;
}

.tests-table td{
    padding:16px;
    border-bottom:1px solid #ececec;
    vertical-align:middle;
}

.tests-table tbody tr:hover{
    background:#fafcff;
}

.tests-table-link{
    color:#1565c0;
    font-weight:600;
    text-decoration:none;
}

.tests-table-link:hover{
    text-decoration:underline;
} */

.status-visible{
    display:inline-block;
    padding:6px 10px;
    border-radius:20px;
    background:#e8f5e9;
    color:#2e7d32;
    font-weight:600;
}

.status-hidden{
    display:inline-block;
    padding:6px 10px;
    border-radius:20px;
    background:#fff3cd;
    color:#856404;
    font-weight:600;
}

/* @media(max-width:1000px){

.tests-table-wrapper{
    overflow-x:auto;
}

.tests-table{
    min-width:900px;
}

} */


/* =======================
   Теми курсу
======================= */

.course-sections{
    display:flex;
    flex-direction:column;
    gap:22px;
    margin-top:25px;
}

.course-section-card{
    position:relative;
    background:#fcfdff;
    border:1px solid #dfe6ee;
    border-left:5px solid #0d6efd;
    border-radius:12px;
    padding:24px;
    transition:.2s;
    margin-bottom:22px;
}

.course-section-card:hover{
    background:#fff;
    box-shadow:0 8px 22px rgba(0,0,0,.08);
}

.section-title{
    font-size:25px;
    font-weight:700;
    color:#1f2937;
    margin-bottom:16px;
    padding-right:90px;
}

.section-description{
    font-size:16px;
    color:#555;
    line-height:1.7;
    margin-bottom:18px;
}

.section-hidden{
    display:inline-block;
    margin-bottom:20px;
    padding:10px 15px;
    border-radius:8px;
    background:#fff3cd;
    border:1px solid #ffe69c;
    color:#856404;
    font-weight:600;
    border-left:5px solid #f39c12;
}

.section-footer{
    margin-top:20px;
    padding-top:18px;
    border-top:1px solid #ececec;
}

.section-footer .btn-inline{
    background:#0d6efd;
    color:#fff;
    text-decoration:none;
    padding:10px 18px;
    border-radius:8px;
    font-weight:600;
    transition:.2s;
}

.section-footer .btn-inline:hover{
    background:#0b5ed7;
}

.course-section-card .test-admin{
    position:absolute;
    top:18px;
    right:18px;
}

/* =======================
   Адаптивність
======================= */

@media(max-width:768px){

    .course-section-card{
        padding:18px;
    }

    .section-title{
        font-size:21px;
        padding-right:0;
        margin-top:35px;
    }

    .course-section-card .test-admin{
        top:15px;
        right:15px;
    }

}

.section-title-link{

    color:#1f2937;
    text-decoration:none;
    transition:.2s;

}

.section-title-link:hover{

    color:#0d6efd;

}

.course-header-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:20px;
}
@media(max-width:768px){

    .course-header-top{
        flex-direction:column;
        align-items:flex-start;
    }

}

.view-section{

    margin-top:25px;

}

.section-head{

    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;

}

.section-head h2{

    font-size:28px;
    margin:0;

}

.activity-list{

    display:flex;
    flex-direction:column;
    gap:15px;
    margin-top:25px;

}

.activity-card{

    display:flex;
    gap:18px;
    align-items:flex-start;
    background:#fff;
    border:1px solid #e5e5e5;
    border-radius:12px;
    padding:18px;
    text-decoration:none;
    color:#222;
    transition:.2s;

}

.activity-card:hover{

    transform:translateY(-2px);
    box-shadow:0 6px 20px rgba(0,0,0,.08);

}

.activity-icon{

    width:48px;
    height:48px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:24px;
    background:#f5f7fb;
    border-radius:10px;
    flex-shrink:0;

}

.activity-info{

    flex:1;

}

.activity-name{

    font-size:18px;
    font-weight:600;
    margin-bottom:8px;

}

.activity-description{

    color:#666;
    line-height:1.6;

}

.section-hidden{

    margin-top:20px;
    padding:12px 16px;
    background:#fff3cd;
    color:#856404;
    border-radius:8px;
    border:1px solid #ffeeba;

}



.activity-modal-overlay{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.45);
    z-index:9999;
}

.activity-modal-overlay.show{
    display:flex;
}

.activity-modal{
    width:520px;
    max-width:95%;
    background:#fff;
    border-radius:18px;
    padding:28px;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
    animation:activityPopup .2s ease;
}

@keyframes activityPopup{

    from{
        opacity:0;
        transform:translateY(-20px) scale(.97);
    }

    to{
        opacity:1;
        transform:none;
    }

}

.activity-modal h2{
    margin:0 0 10px;
    font-size:28px;
}

.activity-modal-subtitle{
    color:#666;
    margin-bottom:22px;
}

.activity-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.activity-item{
    display:flex;
    align-items:center;
    gap:16px;
    border:2px solid #ddd;
    border-radius:12px;
    padding:15px 18px;
    cursor:pointer;
    transition:.2s;
}

.activity-item:hover{
    background:#f7f9fc;
    border-color:#0d6efd;
}

.activity-item input{
    display:none;
}

.activity-item .icon{
    font-size:24px;
}

.activity-item:has(input:checked){
    background:#eef5ff;
    border-color:#0d6efd;
}

.activity-modal-buttons{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:28px;
}

.btn-secondary{
    background:#ececec;
    color:#333;
}

.btn-secondary:hover{
    background:#dfdfdf;
}

#confirmActivity:disabled{
    opacity:.45;
    cursor:not-allowed;
}

/* =======================
   Діяльності у темі
======================= */

/* =====================================
        Види діяльності у темі
===================================== */

.section-activities{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:18px;
}

.section-module{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;

    padding:14px 18px;

    background:#fff;
    border:1px solid #e4e8ef;
    border-radius:12px;

    transition:.2s;
}

.section-module:hover{
    border-color:#0d6efd;
    box-shadow:0 4px 14px rgba(13,110,253,.12);
}

.section-module-left{
    display:flex;
    align-items:center;
    gap:15px;
    min-width:0;
    flex:1;
}

.section-module-icon{
    width:48px;
    height:48px;

    display:flex;
    align-items:center;
    justify-content:center;

    flex-shrink:0;

    border-radius:10px;

    background:#eef5ff;

    font-size:24px;
}

.section-module-info{
    min-width:0;
}

.section-module-name{
    display:inline-block;

    font-size:18px;
    font-weight:600;

    color:#1f2937;
    text-decoration:none;

    transition:.2s;
}

.section-module-name:hover{
    color:#0d6efd;
}

.section-module-type{
    margin-top:4px;

    font-size:14px;

    color:#6b7280;
}

.section-module-hidden{
    flex-shrink:0;

    padding:6px 12px;

    border-radius:999px;

    background:#fff3cd;

    color:#856404;

    font-size:13px;
    font-weight:600;

    border:1px solid #ffe69c;
}

@media(max-width:768px){

    .section-module{
        flex-direction:column;
        align-items:flex-start;
    }

    .section-module-hidden{
        margin-left:63px;
    }

}


.section-module-hidden{
    display:inline-block;
    padding:5px 10px;
    border-radius:20px;
    background:#fff3cd;
    color:#856404;
    font-size:13px;
    font-weight:600;
    white-space:nowrap;
}

.section-module-name{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:24px;
}

.test-visible-checkbox{
    display:flex;
    align-items:center;
    gap:12px;

    margin:18px 0;

    padding:14px 16px;

    border:1px solid #dbe4ef;
    border-radius:10px;

    background:#f8fbff;

    cursor:pointer;

    font-size:16px;
    font-weight:600;
}

.test-visible-checkbox:hover{
    background:#eef6ff;
}

.test-visible-checkbox input{
    width:20px;
    height:20px;

    accent-color:#0d6efd;

    cursor:pointer;
}

.test-visible-checkbox span{
    color:#333;
}

.section-module{
    position: relative;
}

.section-module-admin{
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.enroll-modal{

    display:none;

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.55);

    justify-content:center;

    align-items:center;

    z-index:9999;

    padding:25px;

    box-sizing:border-box;

}

.enroll-modal-content{

    background:#fff;

    width:min(1100px,95vw);

    max-height:90vh;

    overflow-y:auto;

    border-radius:14px;

    padding:30px;

    box-sizing:border-box;

    box-shadow:0 20px 60px rgba(0,0,0,.25);

}

.enroll-modal-actions{

    margin-top:25px;

    display:flex;

    justify-content:flex-end;

    gap:12px;

}

#saveEnrollment{

    font-size:18px;

    font-weight:600;

    padding:12px 26px;

}

#selectedUsersTable{

    background:#fff;

    border-radius:10px;

    overflow:hidden;

    margin-top:10px;
width:100%;
    min-width:600px;
    border-collapse:collapse;

}

#selectedUsersTable th,
#selectedUsersTable td{

    padding:14px;

    word-break:break-word;

}

#selectedUsersTable th:nth-child(2),
#selectedUsersTable td:nth-child(2){
    width:100%;
}
#selectedUsersTable th:last-child,
#selectedUsersTable td:last-child{
    white-space:nowrap;
}
.participants-cancel-btn{

    padding:12px 26px;

    font-size:18px;

    font-weight:600;

    background:#ffffff;

    color:#444;

    border:1px solid #cfcfcf;

    border-radius:8px;

    cursor:pointer;

    transition:.2s;

}

.participants-cancel-btn:hover{

    background:#f2f2f2;

}


.enroll-modal-header{

display:flex;

justify-content:space-between;

align-items:center;

margin-bottom:20px;

}

.enroll-close{

border:none;

background:none;

font-size:22px;

cursor:pointer;

}

.enroll-search input{

width:100%;

padding:12px;

font-size:17px;

margin-bottom:15px;

}

.search-results{

    background:#fff;

    border:1px solid #dcdcdc;

    border-radius:10px;

    min-height:300px;

    max-height:320px;

    overflow-y:auto;
    overflow-x: hidden;

}

.search-placeholder{

text-align:center;

padding:40px;

color:#888;

}

.search-user{

display:flex;

justify-content:space-between;

align-items:center;

padding:10px 12px;

border-bottom:1px solid #ececec;

}

.search-user:last-child{

border:none;

}

.search-user:hover{

background:#f7f9fc;

}

.add-user-btn{

width:36px;

height:36px;

border:none;

border-radius:50%;

cursor:pointer;

font-size:20px;

background:#0d6efd;

color:#fff;

}

.add-user-btn:hover{

background:#0a58ca;

}

.add-user-btn.added{

background:#198754;

cursor:default;

}

@media(max-width:900px){

    .enroll-modal-content{

        width:98%;

    }

}

.selected-users-wrapper{
    width:100%;
    overflow-x:auto;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
}

.search-user-info{

    display:flex;
    flex-direction:column;
    gap:4px;

}

.search-user-email{

    color:#666;
    font-size:14px;

}

.selected-user-name{

    font-weight:600;
    color:#222;

}

.selected-user-email{

    margin-top:4px;
    color:#666;
    font-size:14px;

}

.remove-selected-user{

    padding:8px 14px;

    border:none;

    border-radius:8px;

    background:#dc3545;

    color:#fff;

    font-size:14px;

    font-weight:600;

    cursor:pointer;

    transition:.2s;

}

.remove-selected-user:hover{

    background:#bb2d3b;

}

.add-user-btn{

    width:42px;

    height:42px;

    flex-shrink:0;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:20px;

    font-weight:700;

    line-height:1;

}

.add-user-btn.added{

    background:#198754;

    color:#fff;

}

.participants-success-message{

    background:#d4edda;
    color:#155724;
    border:1px solid #c3e6cb;

    padding:14px 18px;
    margin-bottom:20px;

    border-radius:8px;

    font-size:15px;
    font-weight:600;

    transition:opacity .3s ease;

}

.selected-user-expire{
    margin-top:6px;
    font-size:13px;
    color:#666;
}

.selected-user-expire strong{
    color:#333;
}

.user-expire-error{
    display:none;
    margin-top:8px;
    padding:10px 12px;
    background:#fdeaea;
    border:1px solid #e74c3c;
    color:#c0392b;
    border-radius:6px;
    font-size:14px;
    line-height:1.4;
}

.user-expire-group{
    margin-top:12px;
}

.user-expire-label{
    display:block;
    margin-bottom:6px;
    font-size:14px;
    font-weight:600;
    color:#444;
}

.user-expire-date{
    width:100%;
    box-sizing:border-box;

    padding:11px 14px;

    border:1px solid #d8d8d8;
    border-radius:8px;

    background:#fff;

    font-size:15px;
    color:#333;

    cursor:pointer;

    transition:.2s;
}

.user-expire-date:hover{
    border-color:#8ab4ff;
}

.user-expire-date:focus{
    outline:none;
    border-color:#0d6efd;
    box-shadow:0 0 0 3px rgba(13,110,253,.15);
}

.flatpickr-input[readonly]{
    background:#fff;
}







.user-enroll-error{
    display:none;
    margin-top:8px;
    padding:10px 12px;
    background:#fdeaea;
    border:1px solid #e74c3c;
    color:#c0392b;
    border-radius:6px;
    font-size:14px;
    line-height:1.4;
}

.user-enroll-group{
    margin-top:12px;
}

.user-enroll-label{
    display:block;
    margin-bottom:6px;
    font-size:14px;
    font-weight:600;
    color:#444;
}

.user-enroll-date{
    width:100%;
    box-sizing:border-box;

    padding:11px 14px;

    border:1px solid #d8d8d8;
    border-radius:8px;

    background:#fff;

    font-size:15px;
    color:#333;

    cursor:pointer;

    transition:.2s;
}

.user-enroll-date:hover{
    border-color:#8ab4ff;
}

.user-enroll-date:focus{
    outline:none;
    border-color:#0d6efd;
    box-shadow:0 0 0 3px rgba(13,110,253,.15);
}


.bulk-date-settings{

    margin:20px 0 25px 0;

    padding:20px;

    background:#f8fafc;

    border:1px solid #dbe4ee;

    border-radius:12px;

}

.bulk-date-option{

    display:flex;

    align-items:center;

    cursor:pointer;

    margin-bottom:14px;

    user-select:none;

}

.bulk-date-option:last-of-type{

    margin-top:20px;

}

.bulk-date-option input{

    display:none;

}

.bulk-checkbox{

    width:22px;

    height:22px;

    border:2px solid #1976d2;

    border-radius:6px;

    background:#fff;

    margin-right:12px;

    position:relative;

    transition:.2s;

}

.bulk-date-option input:checked + .bulk-checkbox{

    background:#1976d2;

}

.bulk-date-option input:checked + .bulk-checkbox::after{

    content:"✓";

    color:#fff;

    font-size:15px;

    position:absolute;

    left:50%;

    top:50%;

    transform:translate(-50%,-52%);

}

.bulk-label{

    font-size:15px;

    font-weight:600;

    color:#2c3e50;

}

.bulk-date-wrapper{

    margin:12px 0 18px 34px;

    padding:16px;

    background:#fff;

    border:1px solid #d7dee7;

    border-radius:10px;

}

.bulk-date-title{

    display:block;

    font-weight:600;

    margin-bottom:8px;

    color:#34495e;

}

.bulk-date-input{

    width:320px;

    max-width:100%;

    padding:10px 12px;

    border:1px solid #ccd6e0;

    border-radius:8px;

    background:#fff;

    font-size:14px;

    cursor:pointer;

}

.bulk-date-input:focus{

    border-color:#1976d2;

    outline:none;

}


.bulk-date-error{
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdeaea;
    border: 1px solid #e74c3c;
    color: #c0392b;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.participants-actions{
    display:flex;
    justify-content:center;
    gap:8px;
}

.participant-edit-btn,
.participant-delete-btn{
    width:40px;
    height:40px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    color:#fff;
    font-size:18px;
    transition:.2s;
}

.participant-edit-btn{
    background:#f4b63f;
}

.participant-edit-btn:hover{
    background:#d89a22;
    transform:scale(1.05);
}

.participant-delete-btn{
    background:#ef4444;
}

.participant-delete-btn:hover{
    background:#dc2626;
    transform:scale(1.05);
}

.course-blocked-message{
    margin-bottom:15px;
    padding:12px 16px;
    background:#fff8d6;
    border:1px solid #f2d56b;
    border-left:5px solid #e0b400;
    border-radius:8px;
    color:#6d5600;
    font-weight:700;
    text-align:center;
    letter-spacing:.3px;
}

.participants-success-message{
    background:#e8f8e8;
    border:1px solid #77c577;
    color:#1b6b1b;
    padding:16px 20px;
    border-radius:10px;
    margin-bottom:20px;
    font-size:17px;
    font-weight:600;
    transition:opacity .5s ease;
}

.assignment-info-table{
    display:table !important;
}

.assignment-info-table tbody{
    display:table-row-group !important;
}

.assignment-info-table tr{
    display:table-row !important;
}

.assignment-info-table th{
    display:table-cell !important;
}

.assignment-info-table td{
    display:table-cell !important;
}

@media(max-width:768px){

.assignment-info-table,
.assignment-info-table tbody,
.assignment-info-table tr,
.assignment-info-table td,
.assignment-info-table th{
    display:block;
}

.assignment-info-table tr{
    margin-bottom:15px;
}

.assignment-info-table th{
    width:100%;
    border-bottom:none;
}

.assignment-info-table td{
    border-top:none;
}

}

.assignment-info-table{
    width:100%;
    margin:25px 0;
    border-collapse:collapse;
    border:1px solid #d8d8d8;
    background:#fff;
    border-radius:8px;
    overflow:hidden;
}

.assignment-info-table tr:nth-child(even){
    background:#fafafa;
}

.assignment-info-table th{
    width:320px;
    background:#f4f6f9;
    color:#1d3557;
    text-align:left;
    padding:14px 18px;
    border:1px solid #ddd;
    font-weight:700;
}

.assignment-info-table td{
    padding:14px 18px;
    border:1px solid #ddd;
    color:#333;
}

.submission-card{
    background:#fff;
    border-radius:10px;
    padding:30px;
    margin-top:30px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.submission-info{
    font-size:18px;
    margin-bottom:20px;
    line-height:1.8;
}

.file-drop-zone{
    border:3px dashed #b8c3d6;
    border-radius:10px;
    padding:60px 20px;
    text-align:center;
    cursor:pointer;
    transition:.2s;
}

.file-drop-zone:hover{
    border-color:#1976d2;
    background:#f7fbff;
}

.file-drop-zone.drag{
    border-color:#1976d2;
    background:#eef6ff;
}

.drop-icon{
    font-size:70px;
    margin-bottom:10px;
}

.drop-text{
    font-size:22px;
}

.drop-text span{
    color:#1565c0;
    font-weight:bold;
    text-decoration:underline;
}

.selected-files{
    margin-top:20px;
}

.selected-file{
    padding:10px;
    border-bottom:1px solid #ddd;
    font-size:17px;
}

.submission-buttons{
    margin-top:35px;
    display:flex;
    gap:15px;
}

.cancel-submission-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 28px;
    border-radius:6px;
    text-decoration:none;
    background:#cfcfcf;
    color:#000;
    font-size:18px;
    font-weight:600;
}

.cancel-submission-btn:hover{
    background:#bdbdbd;
}

/* ===============================
   Стилізований чекбокс
================================ */

.submit-now-wrapper{
    margin-top:30px;
}

.custom-checkbox{
    display:flex;
    align-items:center;
    gap:14px;
    cursor:pointer;
    font-size:17px;
    user-select:none;
}

.custom-checkbox input{
    display:none;
}

.checkmark{

    width:22px;
    height:22px;

    border:2px solid #2c7be5;
    border-radius:5px;

    position:relative;

    transition:.2s;

    background:#fff;

}

.custom-checkbox input:checked+.checkmark{

    background:#2c7be5;

}

.custom-checkbox input:checked+.checkmark::after{

    content:"";

    position:absolute;

    left:6px;
    top:2px;

    width:5px;
    height:10px;

    border:solid white;

    border-width:0 3px 3px 0;

    transform:rotate(45deg);

}

/* ===============================
   Попередження
================================ */

.submit-warning{

    display:none;

    margin-top:18px;

    padding:18px;

    background:#fff8d5;

    border:1px solid #e7d17a;

    border-radius:8px;

    color:#7b5c00;

    line-height:1.5;

    animation:fadeIn .25s;

}

.submit-warning.show{

    display:block;

}

@keyframes fadeIn{

    from{

        opacity:0;
        transform:translateY(-8px);

    }

    to{

        opacity:1;
        transform:none;

    }

}

/* ===============================
   Модальне вікно
================================ */

.modal-overlay{

    position:fixed;

    left:0;
    top:0;

    width:100%;
    height:100%;

    background:rgba(0,0,0,.45);

    display:none;

    justify-content:center;
    align-items:center;

    z-index:99999;

}

.modal-overlay.show{

    display:flex;

}

.submit-modal{

    background:#fff;

    width:500px;
    max-width:95%;

    border-radius:10px;

    padding:30px;

    box-shadow:0 20px 60px rgba(0,0,0,.2);

}

.submit-modal h3{

    margin-top:0;
    margin-bottom:20px;

}

.submit-modal p{

    margin-bottom:18px;

    line-height:1.6;

}

.modal-buttons{

    display:flex;

    justify-content:flex-end;

    gap:15px;

    margin-top:30px;

}

.upload-progress-wrapper{
    display:none;
    margin-top:18px;
}

.upload-progress-bar{
    width:100%;
    height:18px;
    background:#ececec;
    border-radius:20px;
    overflow:hidden;
}

.upload-progress-fill{
    width:0%;
    height:100%;
    background:#2d8cff;
    transition:width .2s;
}

.upload-percent{
    margin-top:8px;
    text-align:right;
    font-weight:600;
    color:#555;
}

.upload-success{
    display:none;
    margin-top:15px;
    padding:12px 15px;
    border-radius:10px;
    background:#d9f6df;
    border:1px solid #9bd5aa;
    color:#1f6d35;
    font-weight:600;
}

.upload-error{
    display:none;
    margin-top:15px;
    padding:12px 15px;
    background:#fdecec;
    border:1px solid #e56a6a;
    color:#b10000;
    border-radius:8px;
    font-weight:600;
}

.selected-file-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
}

.selected-file-info{
    flex:1;
}

.remove-file-btn{
    width:32px;
    height:32px;
    border:none;
    border-radius:50%;
    background:#dc3545;
    color:#fff;
    cursor:pointer;
    font-size:15px;
    transition:.2s;
}

.remove-file-btn:hover{
    background:#b91c1c;
}

.assignment-info-table tr td.status-draft{
    background:#fdef80 !important;
    font-weight: bold;
}

.assignment-info-table tr td.status-submitted{
    background:#24ff24 !important;
    font-weight: bold;
}

.submitted-early-box{
    display:inline-block;
    background:#dff6df;
    color:#1b5e20;
    padding:10px 16px;
    border-radius:8px;
    font-weight:600;
}

.assignment-draft-warning{
    margin-top:20px;
    padding:16px 18px;
    background:#ffe5e5;
    border:1px solid #f5b4b4;
    border-left:5px solid #d32f2f;
    border-radius:8px;
    color:#8b1f1f;
    font-size:18px;
    line-height:1.5;
}

.assignment-draft-warning strong{
    font-size:18px;
}

.submitted-late-box{
    background:#ffebee;
    color:#b71c1c;
    border:1px solid #ef9a9a;
    padding:12px;
    border-radius:8px;
    font-weight:600;
}

.previous-attempts{
    margin-top:40px;
}

.previous-attempts h2{
    margin-bottom:20px;
}

.attempt-item{
    border:1px solid #ddd;
    border-radius:8px;
    margin-bottom:15px;
    overflow:hidden;
}

.attempt-header{
    background:#f5f5f5;
    padding:15px 20px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
    user-select:none;
}

.attempt-toggle{
    transition:.25s;
}

.attempt-item.open .attempt-toggle{
    transform:rotate(90deg);
}

.attempt-content{
    display:none;
}

.attempt-item.open .attempt-content{
    display:block;
}

.submission-online-text{
    max-width:220px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.submission-files-list a{
    display:block;
    margin-bottom:4px;
    word-break:break-all;
}

.submission-page-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:38px;
    height:38px;
    border-radius:6px;
    background:#fff;
    border:1px solid #d7d7d7;
    text-decoration:none;
    color:#333;
    font-weight:600;
    transition:.2s;
}

.submission-page-btn:hover{
    background:#f3f3f3;
}

.submission-page-btn.active{
    background:#0d6efd;
    color:#fff;
    border-color:#0d6efd;
}


/* =====================================================
   Таблиця робіт користувачів
===================================================== */

.assignment-submissions-wrapper{

    display:block;

    width:100%;

    max-width:100%;

    min-width:0;

    overflow-x:auto;

    overflow-y:hidden;

    box-sizing:border-box;

    border:1px solid #dbe7ff;

    border-radius:16px;

    background:#fff;

}

.assignment-submissions-table{

    width:max-content;

    min-width:100%;

    border-collapse:collapse;

    table-layout:auto;

}

.assignment-submissions-table thead th{

    white-space:nowrap;

}

.assignment-submissions-table td,
.assignment-submissions-table th{

    padding:14px 18px;

    text-align:center;

    vertical-align:middle;

    border-bottom:1px solid #eef3ff;

}

.assignment-submissions-table td{

    white-space:nowrap;

}

.assignment-submissions-table td:nth-child(3){

    white-space:normal;

    min-width:170px;

}

.assignment-submissions-table td:nth-child(10){

    white-space:normal;

    min-width:220px;

    max-width:300px;

    word-break:break-word;

}

.assignment-submissions-table td:nth-child(11){

    min-width:220px;

    white-space:normal;

    word-break:break-word;

}

.assignment-submissions-wrapper::-webkit-scrollbar{

    height:12px;

}

.assignment-submissions-wrapper::-webkit-scrollbar-track{

    background:#edf3ff;

    border-radius:20px;

}

.assignment-submissions-wrapper::-webkit-scrollbar-thumb{

    background:#2d78f2;

    border-radius:20px;

}

.assignment-submissions-wrapper::-webkit-scrollbar-thumb:hover{

    background:#175fce;

}

#submissionsContent{

    width:100%;

}

#bulkDeleteSubmissionForm{

    width:100%;

}

.assignment-submissions-wrapper{

    width:100%;

}

.assignment-submissions-table{

    min-width:100%;

    width:max-content;

}

.attempt-status.not-submitted{
    background:#dc3545;
    color:#fff;
}


/* =====================================================
   CKEDITOR КОНТЕНТ У КАРТЦІ ТЕМИ
===================================================== */

.course-section-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.section-description.ck-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Фото з CKEditor */
.section-description.ck-content img {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;

    height: auto !important;

    box-sizing: border-box;

    margin-left: auto;
    margin-right: auto;
}

/* Якщо CKEditor обгортає фото у figure */
.section-description.ck-content figure {
    max-width: 100% !important;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Фото всередині figure */
.section-description.ck-content figure img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* YouTube / CKEditor Media */
.section-description.ck-content figure.media {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* iframe YouTube */
.section-description.ck-content iframe {
    display: block;

    width: 100% !important;
    max-width: 100% !important;

    height: auto;

    aspect-ratio: 16 / 9;

    border: 0;
}

/* CKEditor media container */
.section-description.ck-content .media {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* ============================================================
   ФІЛЬТРИ ГРУПИ ТА ПРОФЕСІЇ
============================================================ */

.enroll-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.enroll-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enroll-filter label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.enroll-filter select {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 14px;

    border: 1px solid #d6dbe1;
    border-radius: 8px;

    background-color: #fff;
    color: #333;

    font-size: 15px;
    font-family: inherit;

    cursor: pointer;

    outline: none;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 19px,
        calc(100% - 12px) 19px;
    background-size:
        6px 6px,
        6px 6px;
    background-repeat: no-repeat;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.enroll-filter select:hover {
    border-color: #b8c0ca;
}

.enroll-filter select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, .12);
}

.enroll-filter select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.enroll-filter select option {
    font-size: 15px;
    padding: 8px;
}


/* ============================================================
   МОБІЛЬНА ВЕРСІЯ
============================================================ */

@media (max-width: 760px) {

    .enroll-filters {
        grid-template-columns: 1fr;
        gap: 14px;
    }

}

/* =====================================
   VIEW COURSE — MOBILE OVERFLOW FIX
===================================== */

.course-page{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:hidden;
    box-sizing:border-box;
}

.course-page *,
.course-page *::before,
.course-page *::after{
    box-sizing:border-box;
}

.course-layout{
    width:100%;
    max-width:100%;
    min-width:0;
}

.course-main,
.course-sidebar,
.course-section{
    min-width:0;
    max-width:100%;
}

.course-section-card{
    min-width:0;
    max-width:100%;
    overflow:hidden;
}

.section-module{
    min-width:0;
    max-width:100%;
}

.section-module-left{
    min-width:0;
    max-width:100%;
}

.section-module-info{
    min-width:0;
    max-width:100%;
    overflow:hidden;
}

.section-module-name{
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.course-info-card{
    min-width:0;
    max-width:100%;
    overflow:hidden;
}

.course-info-table{
    width:100%;
    max-width:100%;
    table-layout:fixed;
}

.course-info-table td{
    max-width:0;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.course-sidebar-teachers{
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:break-word;
}


/* ---------- Телефон ---------- */

@media(max-width:768px){

    .course-page{
        overflow-x:hidden;
    }

    .course-layout{
        grid-template-columns:minmax(0,1fr);
        width:100%;
    }

    .course-main,
    .course-sidebar{
        width:100%;
        min-width:0;
    }

    .course-section{
        width:100%;
        min-width:0;
        padding:18px;
    }

    .course-section-header{
        width:100%;
        min-width:0;
    }

    .course-section-header h2{
        max-width:100%;
        overflow-wrap:anywhere;
        word-break:break-word;
    }

    .section-module{
        width:100%;
        min-width:0;
    }

    .section-module-left{
        width:100%;
        min-width:0;
    }

    .section-module-info{
        width:100%;
        min-width:0;
    }

    .section-module-name{
        white-space:normal;
        overflow-wrap:anywhere;
        word-break:break-word;
        font-size:20px;
    }

    .section-module-hidden{
        max-width:100%;
        white-space:normal;
        overflow-wrap:anywhere;
    }

    .course-info-table td{
        overflow-wrap:anywhere;
        word-break:break-word;
    }

}

/* =========================================
   МОДАЛЬНЕ ВІКНО "НОВА ДІЯЛЬНІСТЬ"
   МОБІЛЬНА ВЕРСІЯ
========================================= */

@media (max-width: 600px) {

    .activity-modal-overlay {
        padding: 12px;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
    }

    .activity-modal {
        width: 100%;
        max-width: 380px;
        max-height: calc(100vh - 24px);

        box-sizing: border-box;
        padding: 20px 16px;

        border-radius: 16px;

        overflow-y: auto;
        overflow-x: hidden;
    }

    .activity-modal h2 {
        font-size: 22px;
        line-height: 1.25;
        margin: 0 0 8px;
    }

    .activity-modal-subtitle {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 16px;
    }

    .activity-list {
        gap: 8px;
    }

    .activity-item {
        min-height: 48px;
        padding: 10px 12px;

        box-sizing: border-box;
        border-radius: 10px;

        font-size: 15px;
    }

    .activity-item .icon {
        font-size: 20px;
        min-width: 28px;
    }

    .activity-modal-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;

        margin-top: 16px;
    }

    .activity-modal-buttons .btn {
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;

        font-size: 16px !important;
    }

}

/* =========================================================
   МОДАЛЬНЕ ВІКНО ДОДАВАННЯ ДІЯЛЬНОСТІ
   ========================================================= */

.activity-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);

    display: none;
    align-items: center;
    justify-content: center;

    padding: 15px;
    box-sizing: border-box;

    z-index: 9999;
}

.activity-modal-overlay.show {
    display: flex;
}

.activity-modal {
    width: 100%;
    max-width: 500px;

    max-height: calc(100vh - 30px);
    overflow-y: auto;

    background: #fff;
    border-radius: 14px;

    padding: 25px;
    box-sizing: border-box;

    box-shadow: 0 10px 35px rgba(0,0,0,.25);
}

.activity-modal h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.activity-modal-subtitle {
    margin: 0 0 20px;
    color: #666;
    font-size: 15px;
    line-height: 1.4;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;

    min-height: 52px;

    padding: 10px 12px;

    border: 1px solid #ddd;
    border-radius: 9px;

    box-sizing: border-box;

    cursor: pointer;

    transition: background .15s ease,
                border-color .15s ease;
}

.activity-item:hover {
    background: #f5f8ff;
    border-color: #b8c9ee;
}

.activity-item input {
    margin-right: 10px;
}

.activity-item .icon {
    font-size: 22px;
    margin-right: 10px;
}

.activity-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 22px;
}

.activity-modal-buttons .btn {
    min-height: 42px;
    padding: 8px 16px;
}


/* =========================================================
   МОБІЛЬНИЙ ЕКРАН
   ========================================================= */

@media (max-width: 600px) {

    .activity-modal-overlay {
        align-items: center;
        padding: 10px;
    }

    .activity-modal {
        width: 100%;
        max-width: none;

        max-height: calc(100vh - 20px);

        padding: 18px;

        border-radius: 12px;
    }

    .activity-modal h2 {
        font-size: 21px;
        margin-bottom: 6px;
    }

    .activity-modal-subtitle {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .activity-list {
        gap: 6px;
    }

    .activity-item {
        min-height: 46px;
        padding: 8px 10px;

        font-size: 15px;
    }

    .activity-item .icon {
        font-size: 20px;
        margin-right: 8px;
    }

    .activity-modal-buttons {
        flex-direction: column;
        gap: 8px;

        margin-top: 16px;
    }

    .activity-modal-buttons .btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px !important;
    }
    
    .section-head {
        flex-wrap: wrap;
    }

    .section-head h2 {
        width: 100%;
    }

    .section-head .openActivityModal {
        width: 100%;
        box-sizing: border-box;
        margin-top: 10px;
    }

}