/* =========================================================
   KHO PHIẾU HỌC TẬP
   Giao diện đồng bộ trang Infographic/TVO
========================================================= */

.worksheets-page {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 60px;
    color: #0f172a;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Arial, sans-serif;
}

.worksheets-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.worksheets-kicker {
    margin: 0 0 5px 10px;
    color: #4f8df7;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
}

.worksheets-heading h1 {
    margin: 0 0 0 10px;
    color: #14284b;
    font-size: 40px;
    line-height: 1.08;
    font-weight: 900;
}

.worksheets-heading p {
    margin: 8px 0 0 10px;
    color: #71819d;
    font-size: 16px;
    line-height: 1.7;
}

.worksheet-grade-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: -88px 0 24px;
}

.worksheet-grade-btn {
    width: 62px;
    height: 62px;
    min-width: 62px;
    padding: 0;
    border: 1px solid #d7e5f7;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #53647e;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(37, 74, 123, .07);
    transition: .18s ease;
}

.worksheet-grade-btn span {
    font-size: 9px;
    line-height: 1.1;
    color: #71819a;
}

.worksheet-grade-btn strong {
    margin-top: 2px;
    color: #173b78;
    font-size: 21px;
    line-height: 1;
    font-weight: 900;
}

.worksheet-grade-btn:hover {
    transform: translateY(-2px);
    border-color: #8fbaf2;
    background: #f5f9ff;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .11);
}

.worksheet-grade-btn.active {
    border-color: #4f91ee;
    background: #eaf3ff;
    box-shadow: 0 7px 18px rgba(37, 99, 235, .14),
        inset 0 0 0 3px rgba(79, 145, 238, .10);
}

.worksheet-grade-btn.active span { color: #4d82ca; }
.worksheet-grade-btn.active strong { color: #145bc5; }

.worksheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid #dce8f7;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbff 0%, #f1f7ff 100%);
}

.worksheet-current-grade {
    color: #2563eb;
    font-size: 18px;
    font-weight: 900;
}

.worksheet-counter {
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.worksheet-search-wrap {
    width: min(430px, 100%);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #dbe7f7;
    border-radius: 12px;
    background: #fff;
}

.worksheet-search-wrap span { font-size: 16px; }

.worksheet-search-wrap input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #334155;
    font: 500 14px Inter, system-ui, sans-serif;
}

.worksheet-list {
    display: grid;
    gap: 12px;
}

.worksheet-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 108px;
    padding: 16px 18px;
    border: 1px solid #dce8f7;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.worksheet-card:hover {
    transform: translateY(-2px);
    border-color: #b8d4f5;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .10);
}

.worksheet-file-icon {
    width: 62px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7e7fb;
    border-radius: 16px;
    background: linear-gradient(135deg, #eaf3ff, #f5f9ff);
    font-size: 31px;
}

.worksheet-card-content { min-width: 0; }

.worksheet-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 900;
}

.worksheet-card p {
    margin: 5px 0 7px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.worksheet-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.worksheet-card-meta span {
    padding: 4px 8px;
    border-radius: 7px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
}

.worksheet-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
    height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
}

.worksheet-open-btn:hover { transform: translateY(-1px); }

.worksheet-empty {
    min-height: 270px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    border: 1px dashed #cbd9eb;
    border-radius: 18px;
    background: #f8fbff;
}

.worksheet-empty-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 24px;
    background: #eaf3ff;
    font-size: 36px;
}

.worksheet-empty h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 19px;
    font-weight: 900;
}

.worksheet-empty p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

/* ADMIN */
.worksheet-admin-card {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #dce8f7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(37, 99, 235, .055);
}

.worksheet-admin-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
}

.worksheet-admin-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 23px;
}

.worksheet-admin-kicker {
    margin-bottom: 3px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

.worksheet-admin-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    font-weight: 900;
}

.worksheet-admin-heading p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.worksheet-admin-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #e1eaf6;
    border-radius: 15px;
    background: #f8fbff;
}

.worksheet-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.worksheet-form-wide { grid-column: 1 / -1; }

.worksheet-form-group label {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.worksheet-form-group input,
.worksheet-form-group select {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    box-sizing: border-box;
    border: 1px solid #d7e3f2;
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: #334155;
    font: 500 13px Inter, system-ui, sans-serif;
}

.worksheet-form-group input:focus,
.worksheet-form-group select:focus {
    border-color: #8fbaf2;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.worksheet-form-group small {
    color: #64748b;
    font-size: 11px;
}

.worksheet-admin-submit {
    grid-column: 1 / -1;
    min-height: 42px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.worksheet-admin-submit:disabled { opacity: .65; cursor: wait; }

.worksheet-admin-list-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 2px 9px;
    color: #334155;
    font-size: 13px;
}

.worksheet-admin-list-head span { color: #64748b; font-weight: 600; }

.worksheet-admin-list { display: grid; gap: 8px; }

.worksheet-admin-item {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e2eaf5;
    border-radius: 12px;
    background: #fbfdff;
}

.worksheet-admin-file {
    width: 42px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eff6ff;
    font-size: 21px;
}

.worksheet-admin-meta { min-width: 0; }
.worksheet-admin-meta strong,
.worksheet-admin-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worksheet-admin-meta strong { color: #334155; font-size: 12px; font-weight: 800; }
.worksheet-admin-meta span { margin-top: 3px; color: #64748b; font-size: 11px; }

.worksheet-admin-view,
.worksheet-admin-delete {
    min-height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.worksheet-admin-view {
    border: 1px solid #cfe0f5;
    background: #f5f9ff;
    color: #2563eb !important;
}

.worksheet-admin-delete {
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #dc2626;
}

.worksheet-admin-empty {
    padding: 18px;
    border: 1px dashed #d3dfed;
    border-radius: 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.hero-exit-btn,
.hero-exit-btn:hover,
.hero-exit-btn:focus,
.hero-exit-btn:active {
    text-decoration: none !important;
}

@media (max-width: 700px) {
    .worksheets-page {
        width: min(100% - 18px, 1180px);
        margin-top: 14px;
        margin-bottom: 30px;
    }

    .worksheets-heading { margin-bottom: 12px; }

    .worksheets-heading h1 {
        margin-left: 0;
        font-size: 29px;
    }

    .worksheets-heading p {
        margin-left: 0;
        font-size: 14px;
    }

    .worksheets-kicker { margin-left: 0; }

    .worksheet-grade-bar {
        justify-content: flex-end;
        gap: 7px;
        margin: -4px 0 14px;
    }

    .worksheet-grade-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .worksheet-grade-btn strong { font-size: 19px; }
    .worksheet-grade-btn span { font-size: 8px; }

    .worksheet-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 15px;
    }

    .worksheet-search-wrap { width: 100%; }

    .worksheet-card {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
        border-radius: 15px;
    }

    .worksheet-file-icon {
        width: 50px;
        height: 60px;
        border-radius: 13px;
        font-size: 25px;
    }

    .worksheet-card h3 { font-size: 14px; }
    .worksheet-card p { font-size: 12px; }

    .worksheet-open-btn {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .worksheet-admin-card {
        padding: 14px;
        border-radius: 16px;
    }

    .worksheet-admin-form { grid-template-columns: 1fr; }
    .worksheet-form-wide { grid-column: 1; }

    .worksheet-admin-item {
        grid-template-columns: 40px minmax(0,1fr);
    }

    .worksheet-admin-view,
    .worksheet-admin-delete {
        width: 100%;
    }

    .worksheet-admin-view { grid-column: 1; }
    .worksheet-admin-delete { grid-column: 2; }
}

@media (max-width: 390px) {
    .worksheet-grade-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .worksheet-card { padding: 10px; }
    .worksheet-admin-heading p { font-size: 12px; }
}

/* ==========================================================
   BỐ CỤC KHO PHIẾU HỌC TẬP - DẠNG LƯỚI
========================================================== */

.worksheet-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}


/* ==========================================================
   CARD PHIẾU
========================================================== */

.worksheet-card {
    width: 100%;
    min-width: 0;
    min-height: 300px;

    display: flex;
    flex-direction: column;

    padding: 20px;

    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 20px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.worksheet-card:hover {
    transform: translateY(-4px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.10);
}


/* ==========================================================
   ICON PDF
========================================================== */

.worksheet-card-icon {
    width: 68px;
    height: 68px;
    min-width: 68px;

    margin-bottom: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: #eff6ff;
    border: 1px solid #dbeafe;

    font-size: 36px;
}


/* ==========================================================
   TIÊU ĐỀ
========================================================== */

.worksheet-card-title {
    margin: 0 0 8px 0;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 900;

    color: #0f172a;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}


/* ==========================================================
   MÔ TẢ
========================================================== */

.worksheet-card-description {
    margin: 0;

    font-size: 13px;
    line-height: 1.55;

    color: #64748b;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}


/* ==========================================================
   TAG
========================================================== */

.worksheet-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 14px;
}

.worksheet-card-tag {
    display: inline-flex;
    align-items: center;

    padding: 6px 9px;

    border-radius: 9px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 12px;
    font-weight: 800;
}


/* ==========================================================
   NÚT XEM PHIẾU
========================================================== */

.worksheet-card-button {
    width: 100%;

    margin-top: auto;
    padding: 11px 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    border: none;
    border-radius: 11px;

    background: #2563eb;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.worksheet-card-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
}

.worksheet-card-button:active {
    transform: scale(0.98);
}


/* ==========================================================
   LAPTOP
========================================================== */

@media (max-width: 1300px) {

    .worksheet-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1000px) {

    .worksheet-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

}


/* ==========================================================
   TABLET NHỎ
========================================================== */

@media (max-width: 700px) {

    .worksheet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .worksheet-card {
        min-height: 285px;
        padding: 16px;
        border-radius: 17px;
    }

    .worksheet-card-icon {
        width: 58px;
        height: 58px;
        min-width: 58px;

        margin-bottom: 13px;

        border-radius: 15px;

        font-size: 31px;
    }

    .worksheet-card-title {
        font-size: 15px;
    }

    .worksheet-card-description {
        font-size: 12px;
    }

}


/* ==========================================================
   ĐIỆN THOẠI
========================================================== */

@media (max-width: 480px) {

    .worksheet-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .worksheet-card {
        min-height: 0;
        padding: 17px;
    }

}

/* ==========================================================
   KHO PHIẾU HỌC TẬP
   GIAO DIỆN CARD GỌN - 5 PHIẾU / HÀNG
========================================================== */

/* ----------------------------------------------------------
   DANH SÁCH PHIẾU
---------------------------------------------------------- */

.worksheet-list {
    width: 100% !important;
    max-width: none !important;

    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;

    gap: 18px !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box !important;
}


/* ----------------------------------------------------------
   CARD
---------------------------------------------------------- */

.worksheet-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;

    height: 315px !important;
    min-height: 315px !important;

    padding: 20px !important;
    margin: 0 !important;

    display: flex !important;
    flex-direction: column !important;

    box-sizing: border-box !important;

    background: #ffffff !important;

    border: 1px solid #dbeafe !important;
    border-radius: 24px !important;

    box-shadow:
        0 10px 30px rgba(37, 99, 235, 0.06) !important;

    overflow: hidden !important;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease !important;
}


/* ----------------------------------------------------------
   HOVER
---------------------------------------------------------- */

.worksheet-card:hover {
    transform: translateY(-4px) !important;

    border-color: #bfdbfe !important;

    box-shadow:
        0 16px 35px rgba(37, 99, 235, 0.12) !important;
}


/* ----------------------------------------------------------
   ICON FILE
---------------------------------------------------------- */

.worksheet-file-icon {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;

    margin: 0 0 16px 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 17px !important;

    background: #dbeafe !important;
    border: none !important;

    font-size: 30px !important;

    flex-shrink: 0 !important;
}


/* ----------------------------------------------------------
   CONTENT
---------------------------------------------------------- */

.worksheet-card-content {
    flex: 1 !important;

    min-width: 0 !important;

    display: flex !important;
    flex-direction: column !important;
}


/* ----------------------------------------------------------
   TIÊU ĐỀ
---------------------------------------------------------- */

.worksheet-card-content h3 {
    margin: 0 0 8px 0 !important;

    font-size: 17px !important;
    line-height: 1.35 !important;

    font-weight: 900 !important;

    color: #0f172a !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;

    overflow: hidden !important;
}


/* ----------------------------------------------------------
   MÔ TẢ
---------------------------------------------------------- */

.worksheet-card-content p {
    margin: 0 !important;

    font-size: 13px !important;
    line-height: 1.5 !important;

    color: #64748b !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    overflow: hidden !important;
}


/* ----------------------------------------------------------
   TAG PDF + KHỐI
---------------------------------------------------------- */

.worksheet-card-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;

    gap: 8px !important;

    margin-top: 14px !important;
}

.worksheet-card-meta span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 7px 10px !important;

    border-radius: 10px !important;

    background: #eff6ff !important;

    color: #2563eb !important;

    font-size: 12px !important;
    font-weight: 800 !important;

    line-height: 1 !important;
}


/* ----------------------------------------------------------
   NÚT XEM PHIẾU
---------------------------------------------------------- */

.worksheet-open-btn {
    width: 100% !important;

    min-height: 48px !important;

    margin-top: auto !important;

    padding: 0 14px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 6px !important;

    box-sizing: border-box !important;

    border: none !important;
    border-radius: 14px !important;

    background: #2563eb !important;
    color: #ffffff !important;

    font-size: 14px !important;
    font-weight: 900 !important;

    text-decoration: none !important;

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.18) !important;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease !important;
}

.worksheet-open-btn:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;

    text-decoration: none !important;

    transform: translateY(-1px) !important;

    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.24) !important;
}

.worksheet-open-btn span {
    margin-left: 2px !important;
}


/* ==========================================================
   LAPTOP
========================================================== */

@media (max-width: 1300px) {

    .worksheet-list {
        grid-template-columns:
            repeat(4, minmax(0, 1fr)) !important;
    }

}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1050px) {

    .worksheet-list {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;

        gap: 16px !important;
    }

}


/* ==========================================================
   TABLET NHỎ
========================================================== */

@media (max-width: 760px) {

    .worksheet-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 14px !important;
    }

    .worksheet-card {
        height: 295px !important;
        min-height: 295px !important;

        padding: 17px !important;

        border-radius: 20px !important;
    }

    .worksheet-file-icon {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;

        font-size: 27px !important;

        border-radius: 15px !important;
    }

    .worksheet-card-content h3 {
        font-size: 15px !important;
    }

    .worksheet-card-content p {
        font-size: 12px !important;
    }

    .worksheet-open-btn {
        min-height: 44px !important;

        border-radius: 12px !important;

        font-size: 13px !important;
    }

}


/* ==========================================================
   ĐIỆN THOẠI
========================================================== */

@media (max-width: 480px) {

    .worksheet-list {
        grid-template-columns: 1fr !important;

        gap: 12px !important;
    }

    .worksheet-card {
        height: 270px !important;
        min-height: 270px !important;

        padding: 17px !important;

        border-radius: 18px !important;
    }

}

/* ==========================================================
   WORKSHEETS - COMPACT GRID + PAGINATION
   15 PHIẾU / TRANG = 5 CỘT x 3 DÒNG
   Chỉ điều chỉnh giao diện khu vực phiếu
========================================================== */

.worksheet-list {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 !important;

    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(3, 1fr) !important;

    gap: 14px !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
}

.worksheet-card {
    width: 100% !important;
    min-width: 0 !important;
    height: 236px !important;
    min-height: 236px !important;

    display: flex !important;
    flex-direction: column !important;

    margin: 0 !important;
    padding: 14px !important;
    box-sizing: border-box !important;

    border-radius: 18px !important;
    border: 1px solid #dbe7f7 !important;
    background: #fff !important;

    box-shadow: 0 6px 18px rgba(37, 99, 235, .055) !important;
    overflow: hidden !important;

    transition: transform .18s ease,
                box-shadow .18s ease,
                border-color .18s ease !important;
}

.worksheet-card:hover {
    transform: translateY(-3px) !important;
    border-color: #bfd6f3 !important;
    box-shadow: 0 11px 24px rgba(37, 99, 235, .10) !important;
}

.worksheet-file-icon {
    width: 46px !important;
    height: 50px !important;
    min-width: 46px !important;

    margin: 0 0 11px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 13px !important;
    font-size: 24px !important;
}

.worksheet-card-content {
    min-width: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.worksheet-card h3,
.worksheet-card-content h3 {
    margin: 0 0 6px !important;

    font-size: 15px !important;
    line-height: 1.34 !important;
    font-weight: 900 !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
}

.worksheet-card p,
.worksheet-card-content p {
    margin: 0 !important;

    font-size: 12px !important;
    line-height: 1.45 !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
}

.worksheet-card-meta {
    gap: 6px !important;
    margin-top: 9px !important;
}

.worksheet-card-meta span {
    padding: 5px 8px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    line-height: 1 !important;
}

.worksheet-open-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;

    margin-top: auto !important;
    padding: 0 9px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;

    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 900 !important;

    box-shadow: 0 5px 14px rgba(37, 99, 235, .14) !important;
}

/* ==========================================================
   PHÂN TRANG
========================================================== */

.worksheet-pagination {
    width: 100% !important;
    margin: 18px auto 0 !important;
    text-align: center !important;
}

.worksheet-pagination-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.worksheet-page-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 1px solid #d7e5f7 !important;
    border-radius: 9px !important;

    background: #fff !important;
    color: #526784 !important;

    font-size: 12px !important;
    font-weight: 800 !important;

    cursor: pointer !important;
    transition: .18s ease !important;
}

.worksheet-page-btn:hover:not(:disabled) {
    border-color: #8fbaf2 !important;
    background: #f3f8ff !important;
    color: #2563eb !important;
}

.worksheet-page-btn.active {
    border-color: #2563eb !important;
    background: #2563eb !important;
    color: #fff !important;
    box-shadow: 0 5px 13px rgba(37, 99, 235, .18) !important;
}

.worksheet-page-btn:disabled {
    opacity: .4 !important;
    cursor: default !important;
}

.worksheet-pagination-info {
    margin-top: 7px !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1050px) {
    .worksheet-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
    }

    .worksheet-card {
        height: 225px !important;
        min-height: 225px !important;
    }
}

/* ==========================================================
   MOBILE: 2 CỘT
========================================================== */

@media (max-width: 700px) {
    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 11px !important;
    }

    .worksheet-card {
        height: 235px !important;
        min-height: 235px !important;
        padding: 12px !important;
        border-radius: 15px !important;
    }

    .worksheet-file-icon {
        width: 44px !important;
        height: 47px !important;
        min-width: 44px !important;
        margin-bottom: 9px !important;
        border-radius: 12px !important;
        font-size: 22px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        font-size: 13px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        font-size: 11px !important;
    }

    .worksheet-open-btn {
        height: 36px !important;
        min-height: 36px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }
}

/* ==========================================================
   ĐIỆN THOẠI NHỎ: 1 CỘT
========================================================== */

@media (max-width: 480px) {
    .worksheet-list {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .worksheet-card {
        height: 210px !important;
        min-height: 210px !important;
    }
}


/* ==========================================================
   FIX CUỐI - CARD KHÔNG BỊ CẮT NỘI DUNG
   Giữ nguyên toàn bộ logic / chức năng
========================================================== */

.worksheet-list {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.worksheet-card {
    height: 258px !important;
    min-height: 258px !important;
    padding: 14px !important;
    overflow: visible !important;
}

.worksheet-file-icon {
    width: 46px !important;
    height: 48px !important;
    min-width: 46px !important;
    margin-bottom: 9px !important;
    border-radius: 13px !important;
    font-size: 23px !important;
}

.worksheet-card-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

.worksheet-card-content h3,
.worksheet-card h3 {
    font-size: 15px !important;
    line-height: 1.32 !important;
    margin-bottom: 5px !important;
    -webkit-line-clamp: 3 !important;
}

.worksheet-card-content p,
.worksheet-card p {
    font-size: 12px !important;
    line-height: 1.42 !important;
    -webkit-line-clamp: 2 !important;
}

.worksheet-card-meta {
    margin-top: 8px !important;
    gap: 5px !important;
}

.worksheet-card-meta span {
    padding: 5px 8px !important;
    font-size: 10px !important;
}

.worksheet-open-btn {
    flex: 0 0 37px !important;
    height: 37px !important;
    min-height: 37px !important;
    margin-top: 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
}

/* 15 phiếu/trang: luôn tạo không gian đúng cho 3 hàng */
@media (min-width: 1051px) {
    .worksheet-list {
        grid-template-rows: repeat(3, 258px) !important;
    }
}

/* Laptop */
@media (max-width: 1300px) and (min-width: 1051px) {
    .worksheet-card {
        height: 252px !important;
        min-height: 252px !important;
    }

    .worksheet-list {
        grid-template-rows: repeat(3, 252px) !important;
    }
}

/* Tablet */
@media (max-width: 1050px) and (min-width: 701px) {
    .worksheet-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
    }

    .worksheet-card {
        height: 245px !important;
        min-height: 245px !important;
    }
}

/* Mobile: 2 ô */
@media (max-width: 700px) {
    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        gap: 11px !important;
    }

    .worksheet-card {
        height: 240px !important;
        min-height: 240px !important;
        padding: 12px !important;
    }

    .worksheet-file-icon {
        width: 43px !important;
        height: 46px !important;
        min-width: 43px !important;
        font-size: 22px !important;
    }

    .worksheet-card-content h3,
    .worksheet-card h3 {
        font-size: 13px !important;
    }

    .worksheet-card-content p,
    .worksheet-card p {
        font-size: 11px !important;
    }

    .worksheet-open-btn {
        height: 36px !important;
        min-height: 36px !important;
        flex-basis: 36px !important;
        font-size: 11px !important;
    }
}

/* Điện thoại rất nhỏ: 1 ô */
@media (max-width: 480px) {
    .worksheet-list {
        grid-template-columns: 1fr !important;
    }

    .worksheet-card {
        height: 215px !important;
        min-height: 215px !important;
    }
}


/* ==========================================================
   FINAL VISUAL FIX - KHO PHIẾU HỌC TẬP
   Chỉ điều chỉnh giao diện khu vực card.
   Không thay đổi HTML / JavaScript / dữ liệu / xử lý.
========================================================== */

.worksheet-list {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-rows: 286px !important;
    gap: 18px !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
}

.worksheet-card {
    width: 100% !important;
    min-width: 0 !important;
    height: 286px !important;
    min-height: 286px !important;
    padding: 18px !important;
    margin: 0 !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    background: #ffffff !important;
    border: 1px solid #dbe7f7 !important;
    border-radius: 20px !important;

    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.055) !important;

    overflow: hidden !important;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease !important;
}

.worksheet-card:hover {
    transform: translateY(-3px) !important;
    border-color: #bcd5f5 !important;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.105) !important;
}

.worksheet-file-icon {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;

    margin: 0 auto 14px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex-shrink: 0 !important;

    border: 1px solid #d5e5fb !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #e7f1ff 0%, #f3f8ff 100%) !important;

    font-size: 29px !important;
    line-height: 1 !important;
}

.worksheet-card-content {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;

    display: flex !important;
    flex-direction: column !important;
}

.worksheet-card h3,
.worksheet-card-content h3 {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    max-height: 44px !important;

    margin: 0 0 7px !important;

    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 22px !important;
    font-weight: 900 !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;

    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.worksheet-card p,
.worksheet-card-content p {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;

    color: #64748b !important;
    font-size: 13px !important;
    line-height: 18px !important;
    font-weight: 500 !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;

    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.worksheet-card-meta {
    width: 100% !important;
    min-width: 0 !important;

    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;

    gap: 7px !important;
    margin-top: 10px !important;

    flex-shrink: 0 !important;
}

.worksheet-card-meta span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    height: 27px !important;
    box-sizing: border-box !important;
    padding: 0 9px !important;

    border: 1px solid #dceaff !important;
    border-radius: 9px !important;

    background: #eff6ff !important;
    color: #2563eb !important;

    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

.worksheet-open-btn {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;

    margin-top: 12px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    flex: 0 0 42px !important;

    border: 0 !important;
    border-radius: 12px !important;

    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;

    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 900 !important;

    text-decoration: none !important;
    box-shadow: 0 7px 17px rgba(37, 99, 235, .17) !important;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease !important;
}

.worksheet-open-btn:hover {
    transform: translateY(-1px) !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22) !important;
}

.worksheet-open-btn:active {
    transform: translateY(0) !important;
}

/* LAPTOP */
@media (max-width: 1300px) and (min-width: 1051px) {
    .worksheet-list {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-auto-rows: 286px !important;
    }

    .worksheet-card {
        height: 286px !important;
        min-height: 286px !important;
    }
}

/* TABLET */
@media (max-width: 1050px) and (min-width: 761px) {
    .worksheet-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-rows: 278px !important;
        gap: 15px !important;
    }

    .worksheet-card {
        height: 278px !important;
        min-height: 278px !important;
        padding: 16px !important;
    }
}

/* MOBILE - 2 CỘT */
@media (max-width: 760px) and (min-width: 481px) {
    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: 268px !important;
        gap: 13px !important;
    }

    .worksheet-card {
        height: 268px !important;
        min-height: 268px !important;
        padding: 14px !important;
        border-radius: 17px !important;
    }

    .worksheet-file-icon {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        margin-bottom: 12px !important;
        border-radius: 14px !important;
        font-size: 27px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 14px !important;
        line-height: 20px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 12px !important;
        line-height: 16px !important;
    }

    .worksheet-card-meta {
        margin-top: 9px !important;
    }

    .worksheet-card-meta span {
        height: 25px !important;
        padding: 0 8px !important;
        font-size: 10px !important;
    }

    .worksheet-open-btn {
        height: 40px !important;
        min-height: 40px !important;
        flex-basis: 40px !important;
        margin-top: 10px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
    }
}

/* ĐIỆN THOẠI NHỎ - 1 CỘT */
@media (max-width: 480px) {
    .worksheet-list {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 250px !important;
        gap: 11px !important;
    }

    .worksheet-card {
        height: 250px !important;
        min-height: 250px !important;
        padding: 14px !important;
        border-radius: 17px !important;
    }

    .worksheet-file-icon {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        margin-bottom: 11px !important;
        border-radius: 14px !important;
        font-size: 27px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 14px !important;
        line-height: 20px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 12px !important;
        line-height: 16px !important;
    }

    .worksheet-open-btn {
        height: 40px !important;
        min-height: 40px !important;
        flex-basis: 40px !important;
        margin-top: 9px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
    }
}

/* ==========================================================
   NÚT XEM PHIẾU - NHỎ GỌN, NỀN + BORDER, CANH PHẢI
========================================================== */

.worksheet-card .worksheet-open-btn,
a.worksheet-open-btn {
    width: fit-content !important;
    min-width: 0 !important;
    max-width: max-content !important;

    height: 31px !important;
    min-height: 31px !important;

    align-self: flex-end !important;
    flex: 0 0 auto !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;

    margin-top: 8px !important;
    margin-right: 0 !important;
    padding: 0 8px !important;

    border: 1px solid #2563eb !important;
    border-radius: 7px !important;

    background: #2563eb !important;
    color: #fff !important;

    font-size: 12px !important;
    font-weight: 700 !important;

    box-shadow: none !important;
    text-decoration: none !important;
}

.worksheet-card .worksheet-open-btn:hover,
a.worksheet-open-btn:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}


/* Điện thoại */
@media (max-width: 700px) {
    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        height: 29px !important;
        min-height: 29px !important;
        padding: 0 7px !important;
        margin-top: 6px !important;
        font-size: 11px !important;
    }
}

/* ==========================================================
   FIX - KHỐI CHƯA CÓ PHIẾU KHÔNG GIỮ KHOẢNG TRỐNG
   Chỉ áp dụng khi worksheet-list hoàn toàn rỗng
========================================================== */

.worksheet-list:empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================
   CANH GIỮA NÚT XEM PHIẾU TRONG CARD
========================================================== */

.worksheet-card .worksheet-open-btn {
    align-self: center !important;
}

/* ==========================================================
   CANH GIỮA KHỐI TAG LIÊN KẾT + KHỐI
========================================================== */

.worksheet-card .worksheet-card-meta {
    justify-content: center !important;
}

/* ==========================================================
   FIX - TẠO KHOẢNG CÁCH GIỮA CÁC HÀNG PHIẾU
========================================================== */

.worksheet-list {
    row-gap: 24px !important;
}

/* Giữ khoảng cách hợp lý trên tablet */
@media (max-width: 1050px) {
    .worksheet-list {
        row-gap: 20px !important;
    }
}

/* Điện thoại */
@media (max-width: 700px) {
    .worksheet-list {
        row-gap: 16px !important;
    }
}


/* ==========================================================
   FINAL OVERRIDE - KHO PHIẾU HỌC TẬP
   Chỉ xử lý bố cục grid/card khoảng cách và nút xem phiếu.
   Không thay đổi HTML / JavaScript / dữ liệu / chức năng.
========================================================== */

/* DANH SÁCH - desktop 5 cột, các hàng tự xếp và có khoảng cách */
.worksheet-list {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-rows: 286px !important;
    column-gap: 18px !important;
    row-gap: 24px !important;
    align-items: stretch !important;
}

/* CARD */
.worksheet-card {
    height: 286px !important;
    min-height: 286px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* NÚT XEM PHIẾU - nhỏ gọn, nền xanh, border và canh giữa */
.worksheet-card .worksheet-open-btn,
a.worksheet-open-btn {
    width: fit-content !important;
    min-width: 0 !important;
    max-width: max-content !important;

    height: 31px !important;
    min-height: 31px !important;

    align-self: center !important;
    flex: 0 0 auto !important;

    padding: 0 8px !important;
    margin-top: 8px !important;

    border: 1px solid #2563eb !important;
    border-radius: 7px !important;

    background: #2563eb !important;
    color: #fff !important;

    font-size: 12px !important;
    font-weight: 700 !important;

    box-shadow: none !important;
}

/* TABLET */
@media (max-width: 1300px) and (min-width: 1051px) {
    .worksheet-list {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: 286px !important;
        column-gap: 18px !important;
        row-gap: 24px !important;
    }

    .worksheet-card {
        height: 286px !important;
        min-height: 286px !important;
    }
}

/* TABLET */
@media (max-width: 1050px) and (min-width: 761px) {
    .worksheet-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: 278px !important;
        column-gap: 15px !important;
        row-gap: 20px !important;
    }

    .worksheet-card {
        height: 278px !important;
        min-height: 278px !important;
    }
}

/* MOBILE - 2 CỘT */
@media (max-width: 760px) and (min-width: 481px) {
    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: 268px !important;
        column-gap: 13px !important;
        row-gap: 18px !important;
    }

    .worksheet-card {
        height: 268px !important;
        min-height: 268px !important;
    }

    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        height: 30px !important;
        min-height: 30px !important;
        padding: 0 7px !important;
        font-size: 11px !important;
    }
}

/* ĐIỆN THOẠI NHỎ - 1 CỘT */
@media (max-width: 480px) {
    .worksheet-list {
        grid-template-columns: 1fr !important;
        grid-template-rows: none !important;
        grid-auto-rows: 250px !important;
        column-gap: 0 !important;
        row-gap: 16px !important;
    }

    .worksheet-card {
        height: 250px !important;
        min-height: 250px !important;
    }

    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        height: 29px !important;
        min-height: 29px !important;
        padding: 0 7px !important;
        font-size: 11px !important;
    }
}

/* =========================
   SCROLL TOP BUTTON
========================= */

#scrollTopBtn{

    position:fixed;

    bottom:25px;

    right:25px;

    width:50px;

    height:50px;

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    color:white;

    border:none;

    border-radius:50%;

    font-size:20px;

    font-weight:900;

    cursor:pointer;

    box-shadow:
    0 10px 24px rgba(37,99,235,0.28);

    display:none;

    transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;

    z-index:999;

    font-family:inherit;
}

#scrollTopBtn:hover{

    transform:translateY(-2px);

    box-shadow:
    0 14px 28px rgba(37,99,235,0.34);
}

@media(max-width:768px){

    #scrollTopBtn{

        width:34px !important;
        height:34px !important;

        min-width:34px !important;
        min-height:34px !important;

        padding:0 !important;

        border-radius:50% !important;

        display:flex;

        align-items:center;
        justify-content:center;

        line-height:1;

        font-size:15px;

        right:12px;
        bottom:12px;
    }
}

@media(max-width:430px){

    #scrollTopBtn{

        width:32px !important;
        height:32px !important;

        min-width:32px !important;
        min-height:32px !important;

        padding:0 !important;

        border-radius:50% !important;

        display:flex;

        align-items:center;
        justify-content:center;

        line-height:1;

        font-size:14px;

        right:10px;
        bottom:10px;
    }
}
/* ==========================================================
   FINAL MOBILE COMPACT - KHO PHIẾU HỌC TẬP
   Chỉ thu gọn giao diện mobile.
   Giữ nguyên toàn bộ desktop / tablet / chức năng hiện tại.
========================================================== */

/* MOBILE - 2 PHIẾU / HÀNG, CARD CỰC GỌN */
@media (max-width: 760px) {

    .worksheets-page {
        width: calc(100% - 14px) !important;
        margin-top: 10px !important;
        margin-bottom: 22px !important;
    }

    .worksheets-heading {
        margin-bottom: 8px !important;
    }

    .worksheets-heading h1 {
        margin-left: 0 !important;
        font-size: 24px !important;
        line-height: 1.15 !important;
    }

    .worksheets-heading p {
        margin: 4px 0 0 !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .worksheets-kicker {
        margin-left: 0 !important;
        margin-bottom: 3px !important;
        font-size: 10px !important;
    }

    .worksheet-grade-bar {
        gap: 5px !important;
        margin: 0 0 9px !important;
    }

    .worksheet-grade-btn {
        width: 43px !important;
        height: 43px !important;
        min-width: 43px !important;
    }

    .worksheet-grade-btn strong {
        font-size: 16px !important;
    }

    .worksheet-grade-btn span {
        font-size: 7px !important;
    }

    .worksheet-toolbar {
        gap: 7px !important;
        padding: 8px !important;
        margin-bottom: 9px !important;
        border-radius: 11px !important;
    }

    .worksheet-current-grade {
        font-size: 14px !important;
    }

    .worksheet-counter {
        margin-top: 1px !important;
        font-size: 10px !important;
    }

    .worksheet-search-wrap {
        height: 34px !important;
        padding: 0 9px !important;
        gap: 6px !important;
        border-radius: 9px !important;
    }

    .worksheet-search-wrap span {
        font-size: 13px !important;
    }

    .worksheet-search-wrap input {
        font-size: 11px !important;
    }

    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: 185px !important;
        column-gap: 8px !important;
        row-gap: 9px !important;
    }

    .worksheet-card {
        height: 185px !important;
        min-height: 185px !important;
        padding: 10px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, .05) !important;
    }

    .worksheet-file-icon {
        width: 38px !important;
        height: 40px !important;
        min-width: 38px !important;
        min-height: 40px !important;
        margin: 0 auto 7px !important;
        border-radius: 10px !important;
        font-size: 20px !important;
    }

    .worksheet-card-content {
        width: 100% !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 30px !important;
        max-height: 30px !important;
        margin-bottom: 4px !important;
        font-size: 11.5px !important;
        line-height: 15px !important;
        -webkit-line-clamp: 2 !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        min-height: 28px !important;
        max-height: 28px !important;
        font-size: 9.5px !important;
        line-height: 14px !important;
        -webkit-line-clamp: 2 !important;
    }

    .worksheet-card-meta {
        gap: 4px !important;
        margin-top: 6px !important;
    }

    .worksheet-card-meta span {
        height: 21px !important;
        padding: 0 6px !important;
        border-radius: 6px !important;
        font-size: 8px !important;
    }

    .worksheet-open-btn,
    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        width: fit-content !important;
        height: 27px !important;
        min-height: 27px !important;
        flex: 0 0 27px !important;
        margin-top: 6px !important;
        padding: 0 7px !important;
        border-radius: 7px !important;
        font-size: 9px !important;
        box-shadow: none !important;
    }

    .worksheet-pagination {
        margin-top: 10px !important;
    }

    .worksheet-pagination-inner {
        gap: 4px !important;
    }

    .worksheet-page-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        border-radius: 7px !important;
        font-size: 10px !important;
    }

    .worksheet-pagination-info {
        margin-top: 5px !important;
        font-size: 9px !important;
    }
}

/* ĐIỆN THOẠI RẤT NHỎ - VẪN 2 CỘT NHƯNG GỌN HƠN */
@media (max-width: 390px) {

    .worksheets-page {
        width: calc(100% - 10px) !important;
        margin-top: 8px !important;
    }

    .worksheets-heading h1 {
        font-size: 22px !important;
    }

    .worksheets-heading p {
        font-size: 11px !important;
    }

    .worksheet-grade-bar {
        gap: 4px !important;
        margin-bottom: 7px !important;
    }

    .worksheet-grade-btn {
        width: 39px !important;
        height: 39px !important;
        min-width: 39px !important;
    }

    .worksheet-grade-btn strong {
        font-size: 14px !important;
    }

    .worksheet-toolbar {
        padding: 7px !important;
        border-radius: 10px !important;
    }

    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: 172px !important;
        column-gap: 7px !important;
        row-gap: 8px !important;
    }

    .worksheet-card {
        height: 172px !important;
        min-height: 172px !important;
        padding: 8px !important;
        border-radius: 11px !important;
    }

    .worksheet-file-icon {
        width: 34px !important;
        height: 36px !important;
        min-width: 34px !important;
        min-height: 36px !important;
        margin-bottom: 6px !important;
        border-radius: 9px !important;
        font-size: 18px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 28px !important;
        max-height: 28px !important;
        margin-bottom: 3px !important;
        font-size: 10.5px !important;
        line-height: 14px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        min-height: 24px !important;
        max-height: 24px !important;
        font-size: 9px !important;
        line-height: 12px !important;
    }

    .worksheet-card-meta {
        gap: 3px !important;
        margin-top: 5px !important;
    }

    .worksheet-card-meta span {
        height: 19px !important;
        padding: 0 5px !important;
        border-radius: 5px !important;
        font-size: 7.5px !important;
    }

    .worksheet-open-btn,
    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        height: 25px !important;
        min-height: 25px !important;
        flex-basis: 25px !important;
        margin-top: 5px !important;
        padding: 0 6px !important;
        border-radius: 6px !important;
        font-size: 8.5px !important;
    }

    .worksheet-pagination {
        margin-top: 8px !important;
    }
}

/* ==========================================================
   MOBILE - CĂN GIỮA 3 Ô CHỌN KHỐI
========================================================== */
@media (max-width: 760px) {
    .worksheet-grade-bar {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* =========================================================
   MOBILE - HẠ THẤP THÊM CỤM USER
   ========================================================= */

@media (max-width: 768px) {

    .user-card {
        height: 68px !important;
        min-height: 68px !important;
    }

    .hero-exit-btn {
        height: 68px !important;
        min-height: 68px !important;
    }

    .user-avatar {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        border-radius: 10px !important;
        font-size: 19px !important;
    }

    .user-card-top {
        gap: 9px !important;
    }

    .user-card-info {
        gap: 1px !important;
    }

    .user-hello {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .user-name {
        font-size: 18px !important;
        line-height: 1 !important;
    }

    .user-meta {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .hero-exit-btn {
        padding: 5px !important;
        gap: 2px !important;
    }

    .hero-exit-btn .exit-icon {
        font-size: 14px !important;
    }

    .hero-exit-btn .exit-text {
        font-size: 13px !important;
    }
}


@media (max-width: 430px) {

    .user-card {
        height: 64px !important;
        min-height: 64px !important;
    }

    .hero-exit-btn {
        height: 64px !important;
        min-height: 64px !important;
    }

    .user-avatar {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 9px !important;
        font-size: 18px !important;
    }

    .user-name {
        font-size: 17px !important;
    }

    .user-meta {
        font-size: 12px !important;
    }
}

/* ==========================================================
   MOBILE - KHO PHIẾU HỌC TẬP
   CARD THẤP - GỌN - DỄ BẤM
   CHỈ ÁP DỤNG ĐIỆN THOẠI
========================================================== */

@media (max-width: 700px) {

    /* DANH SÁCH: 1 CỘT */
    .worksheet-list {
        display: grid !important;

        grid-template-columns: 1fr !important;
        grid-template-rows: none !important;
        grid-auto-rows: 118px !important;

        gap: 9px !important;
        row-gap: 9px !important;

        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }


    /* CARD */
    .worksheet-card {
        width: 100% !important;

        height: 118px !important;
        min-height: 118px !important;

        padding: 10px 12px !important;
        margin: 0 !important;

        box-sizing: border-box !important;

        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) !important;
        grid-template-rows: 1fr auto !important;

        column-gap: 11px !important;
        row-gap: 3px !important;

        align-items: center !important;

        border-radius: 14px !important;

        overflow: hidden !important;
    }


    /* ICON */
    .worksheet-file-icon {
        width: 44px !important;
        height: 48px !important;
        min-width: 44px !important;
        min-height: 48px !important;

        margin: 0 !important;

        grid-column: 1 !important;
        grid-row: 1 / 3 !important;

        align-self: center !important;

        border-radius: 11px !important;

        font-size: 22px !important;
    }


    /* NỘI DUNG */
    .worksheet-card-content {
        width: 100% !important;
        min-width: 0 !important;

        grid-column: 2 !important;
        grid-row: 1 !important;

        display: flex !important;
        flex-direction: column !important;

        justify-content: center !important;
    }


    /* TIÊU ĐỀ */
    .worksheet-card h3,
    .worksheet-card-content h3 {
        width: 100% !important;

        margin: 0 0 2px !important;

        min-height: 30px !important;
        max-height: 30px !important;

        font-size: 12.5px !important;
        line-height: 15px !important;
        font-weight: 900 !important;

        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }


    /* MÔ TẢ */
    .worksheet-card p,
    .worksheet-card-content p {
        width: 100% !important;

        margin: 0 !important;

        min-height: 15px !important;
        max-height: 15px !important;

        font-size: 10px !important;
        line-height: 15px !important;

        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 1 !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }


    /* TAG */
    .worksheet-card-meta {
        grid-column: 2 !important;
        grid-row: 2 !important;

        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        gap: 4px !important;

        margin: 0 !important;
    }


    .worksheet-card-meta span {
        height: 21px !important;

        padding: 0 7px !important;

        border-radius: 6px !important;

        font-size: 8.5px !important;
        line-height: 1 !important;
    }


    /* NÚT XEM PHIẾU */
    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        position: absolute !important;

        right: 12px !important;
        bottom: 10px !important;

        width: fit-content !important;
        min-width: 0 !important;
        max-width: max-content !important;

        height: 28px !important;
        min-height: 28px !important;

        margin: 0 !important;
        padding: 0 9px !important;

        border-radius: 7px !important;

        font-size: 9.5px !important;
        font-weight: 800 !important;

        box-shadow: none !important;
    }


    /* CARD PHẢI LÀM MỐC CHO NÚT */
    .worksheet-card {
        position: relative !important;
    }
}


/* ==========================================================
   ĐIỆN THOẠI RẤT NHỎ
========================================================== */

@media (max-width: 430px) {

    .worksheet-list {
        grid-auto-rows: 110px !important;
        gap: 8px !important;
    }

    .worksheet-card {
        height: 110px !important;
        min-height: 110px !important;

        padding: 8px 10px !important;

        grid-template-columns: 42px minmax(0, 1fr) !important;
        column-gap: 9px !important;
    }

    .worksheet-file-icon {
        width: 39px !important;
        height: 43px !important;
        min-width: 39px !important;
        min-height: 43px !important;

        border-radius: 10px !important;
        font-size: 20px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 28px !important;
        max-height: 28px !important;

        font-size: 11.5px !important;
        line-height: 14px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        font-size: 9.5px !important;
        line-height: 14px !important;

        min-height: 14px !important;
        max-height: 14px !important;
    }

    .worksheet-card-meta span {
        height: 19px !important;
        padding: 0 6px !important;
        font-size: 8px !important;
    }

    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        right: 10px !important;
        bottom: 8px !important;

        height: 26px !important;
        min-height: 26px !important;

        padding: 0 8px !important;

        font-size: 9px !important;
    }
}

/* ==========================================================
   FINAL MOBILE OVERRIDE - KHO PHIẾU HỌC TẬP
   MỤC ĐÍCH:
   - Giữ nguyên 100% toàn bộ CSS cũ ở phía trên.
   - Chỉ ghi đè giao diện mobile.
   - Card thấp, gọn, 2 cột.
   - Không thay đổi HTML / JavaScript / dữ liệu / chức năng.
   - Đặt ở CUỐI FILE để thắng toàn bộ CSS mobile cũ.
========================================================== */

@media (max-width: 768px) {

    /* KHỐI TRANG */
    .worksheets-page {
        width: calc(100% - 16px) !important;
        margin: 10px auto 24px !important;
    }

    /* TIÊU ĐỀ */
    .worksheets-heading {
        margin-bottom: 8px !important;
    }

    .worksheets-kicker {
        margin: 0 0 2px 0 !important;
        font-size: 9px !important;
        letter-spacing: .10em !important;
    }

    .worksheets-heading h1 {
        margin: 0 !important;
        font-size: 22px !important;
        line-height: 1.15 !important;
    }

    .worksheets-heading p {
        margin: 3px 0 0 !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    /* 3 NÚT KHỐI */
    .worksheet-grade-bar {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 7px !important;
        margin: 4px auto 8px !important;
    }

    .worksheet-grade-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        padding: 0 !important;
    }

    .worksheet-grade-btn strong {
        font-size: 15px !important;
    }

    .worksheet-grade-btn span {
        font-size: 7px !important;
    }

    /* THANH TÌM KIẾM */
    .worksheet-toolbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding: 7px !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    .worksheet-current-grade {
        font-size: 13px !important;
    }

    .worksheet-counter {
        margin-top: 1px !important;
        font-size: 9px !important;
    }

    .worksheet-search-wrap {
        width: 100% !important;
        height: 32px !important;
        padding: 0 8px !important;
        gap: 5px !important;
        border-radius: 8px !important;
    }

    .worksheet-search-wrap span {
        font-size: 12px !important;
    }

    .worksheet-search-wrap input {
        font-size: 10px !important;
    }


    /* ======================================================
       DANH SÁCH PHIẾU
       LUÔN 2 CỘT TRÊN MOBILE
    ====================================================== */

    .worksheet-list {
        width: 100% !important;
        max-width: none !important;

        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: 112px !important;

        column-gap: 8px !important;
        row-gap: 8px !important;

        margin: 0 !important;
        padding: 0 !important;
    }


    /* ======================================================
       CARD - CHỈ 112PX
    ====================================================== */

    .worksheet-card {
        position: relative !important;

        width: 100% !important;
        min-width: 0 !important;

        height: 112px !important;
        min-height: 112px !important;
        max-height: 112px !important;

        padding: 8px !important;
        margin: 0 !important;

        box-sizing: border-box !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;

        border-radius: 12px !important;

        overflow: hidden !important;
    }


    /* ICON */
    .worksheet-file-icon {
        width: 36px !important;
        height: 38px !important;
        min-width: 36px !important;
        min-height: 38px !important;
        max-width: 36px !important;
        max-height: 38px !important;

        margin: 0 0 5px !important;

        flex: 0 0 38px !important;

        border-radius: 9px !important;
        font-size: 19px !important;
        line-height: 1 !important;
    }


    /* CONTENT */
    .worksheet-card-content {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;

        flex: 1 1 auto !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;

        overflow: hidden !important;
    }


    /* TIÊU ĐỀ */
    .worksheet-card h3,
    .worksheet-card-content h3 {
        width: 100% !important;

        margin: 0 0 2px !important;

        min-height: 26px !important;
        max-height: 26px !important;

        font-size: 10.5px !important;
        line-height: 13px !important;
        font-weight: 900 !important;

        text-align: center !important;

        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;

        word-break: normal !important;
        overflow-wrap: break-word !important;
    }


    /* MÔ TẢ */
    .worksheet-card p,
    .worksheet-card-content p {
        width: 100% !important;

        margin: 0 !important;

        min-height: 13px !important;
        max-height: 13px !important;

        font-size: 8.5px !important;
        line-height: 13px !important;

        text-align: center !important;

        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 1 !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }


    /* TAG */
    .worksheet-card-meta {
        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;

        gap: 3px !important;
        margin: 3px 0 0 !important;

        flex-shrink: 0 !important;
    }

    .worksheet-card-meta span {
        height: 18px !important;
        min-height: 18px !important;

        padding: 0 5px !important;

        border-radius: 5px !important;

        font-size: 7.5px !important;
        line-height: 1 !important;

        white-space: nowrap !important;
    }


    /* NÚT XEM PHIẾU */
    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        position: absolute !important;

        left: 50% !important;
        right: auto !important;
        bottom: 7px !important;

        transform: translateX(-50%) !important;

        width: auto !important;
        min-width: 0 !important;
        max-width: calc(100% - 16px) !important;

        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;

        margin: 0 !important;
        padding: 0 7px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 6px !important;

        font-size: 8.5px !important;
        line-height: 1 !important;
        font-weight: 800 !important;

        white-space: nowrap !important;

        box-shadow: none !important;
    }

    .worksheet-card .worksheet-open-btn:hover,
    a.worksheet-open-btn:hover {
        transform: translateX(-50%) translateY(-1px) !important;
    }


    /* PHÂN TRANG */
    .worksheet-pagination {
        margin-top: 9px !important;
    }

    .worksheet-pagination-inner {
        gap: 4px !important;
    }

    .worksheet-page-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;

        border-radius: 7px !important;
        font-size: 9px !important;
    }

    .worksheet-pagination-info {
        margin-top: 4px !important;
        font-size: 8.5px !important;
    }
}


/* ==========================================================
   MOBILE RẤT NHỎ
   VẪN 2 CỘT - THẤP HƠN
========================================================== */

@media (max-width: 430px) {

    .worksheets-page {
        width: calc(100% - 10px) !important;
        margin-top: 8px !important;
    }

    .worksheets-heading h1 {
        font-size: 20px !important;
    }

    .worksheets-heading p {
        font-size: 10px !important;
    }

    .worksheet-grade-bar {
        gap: 6px !important;
        margin-top: 3px !important;
        margin-bottom: 7px !important;
    }

    .worksheet-grade-btn {
        width: 39px !important;
        height: 39px !important;
        min-width: 39px !important;
    }

    .worksheet-grade-btn strong {
        font-size: 14px !important;
    }

    .worksheet-toolbar {
        padding: 6px !important;
        margin-bottom: 7px !important;
    }

    .worksheet-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: 104px !important;
        column-gap: 7px !important;
        row-gap: 7px !important;
    }

    .worksheet-card {
        height: 104px !important;
        min-height: 104px !important;
        max-height: 104px !important;
        padding: 7px !important;
        border-radius: 10px !important;
    }

    .worksheet-file-icon {
        width: 33px !important;
        height: 35px !important;
        min-width: 33px !important;
        min-height: 35px !important;
        max-width: 33px !important;
        max-height: 35px !important;

        flex-basis: 35px !important;

        margin-bottom: 4px !important;

        border-radius: 8px !important;
        font-size: 17px !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        min-height: 24px !important;
        max-height: 24px !important;

        font-size: 9.5px !important;
        line-height: 12px !important;
    }

    .worksheet-card p,
    .worksheet-card-content p {
        min-height: 12px !important;
        max-height: 12px !important;

        font-size: 8px !important;
        line-height: 12px !important;
    }

    .worksheet-card-meta {
        gap: 2px !important;
        margin-top: 2px !important;
    }

    .worksheet-card-meta span {
        height: 17px !important;
        min-height: 17px !important;
        padding: 0 4px !important;
        border-radius: 4px !important;
        font-size: 7px !important;
    }

    .worksheet-card .worksheet-open-btn,
    a.worksheet-open-btn {
        bottom: 6px !important;
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;

        padding: 0 6px !important;
        border-radius: 5px !important;

        font-size: 8px !important;
    }

    .worksheet-pagination {
        margin-top: 7px !important;
    }
}

/* =====================================================
   FIX: NÚT XEM PHIẾU CĂN GIỮA + CÓ KHOẢNG CÁCH
===================================================== */

.worksheet-card .worksheet-open-btn {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 12px auto 0 !important;

    z-index: 10 !important;
    white-space: nowrap !important;
}

@media (max-width: 760px) {
    .worksheet-card .worksheet-open-btn {
        margin: 10px auto 0 !important;
    }
}

@media (max-width: 480px) {
    .worksheet-card .worksheet-open-btn {
        margin: 9px auto 0 !important;
    }
}

/* ==========================================================
   FIX MOBILE — TIÊU ĐỀ KHO PHIẾU HỌC TẬP
   Không thay đổi desktop
   Không thay đổi HTML / JavaScript
   ========================================================== */

@media (max-width: 768px) {

    .worksheets-page {
        width: calc(100% - 20px) !important;
        margin: 12px auto 28px !important;
        padding-top: 8px !important;
        box-sizing: border-box !important;
    }

    .worksheets-heading {
        width: 100% !important;
        margin: 0 0 12px 0 !important;
        padding: 0 !important;

        display: block !important;
        overflow: visible !important;
    }

    .worksheets-heading > div {
        width: 100% !important;
        min-width: 0 !important;
    }

    .worksheets-kicker {
        display: block !important;

        margin: 0 0 4px 0 !important;
        padding: 0 !important;

        font-size: 10px !important;
        line-height: 14px !important;
        letter-spacing: .10em !important;

        white-space: normal !important;
        overflow: visible !important;
    }

    .worksheets-heading h1 {
        display: block !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        margin: 0 !important;
        padding: 0 !important;

        font-size: 24px !important;
        line-height: 1.2 !important;
        font-weight: 900 !important;

        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    .worksheets-heading p {
        display: block !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        margin: 5px 0 0 0 !important;
        padding: 0 !important;

        font-size: 12px !important;
        line-height: 1.4 !important;

        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
}

/* ==========================================================
   FINAL SAFARI iPHONE FIX
   FIX CHỮ TIÊU ĐỀ CARD BỊ CẮT PHẦN TRÊN
   Giữ nguyên bố cục hiện tại
   Chỉ áp dụng cho điện thoại
   ========================================================== */

@media screen and (max-width: 768px) {

    /* CONTENT CARD */
    .worksheet-card-content {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;

        overflow: visible !important;
        box-sizing: border-box !important;
    }

    /* TIÊU ĐỀ PHIẾU */
    .worksheet-card h3,
    .worksheet-card-content h3 {
        width: 100% !important;

        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;

        margin: 0 0 2px 0 !important;
        padding: 2px 0 0 0 !important;

        box-sizing: border-box !important;

        font-size: 10.5px !important;
        line-height: 12px !important;
        font-weight: 900 !important;

        text-align: center !important;

        /* Bỏ cơ chế line-clamp gây lỗi hiển thị trên Safari */
        display: block !important;
        -webkit-box-orient: initial !important;
        -webkit-line-clamp: initial !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;

        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;

        /* Safari */
        -webkit-font-smoothing: antialiased !important;
        -webkit-text-size-adjust: 100% !important;
    }
}


/* ==========================================================
   iPHONE NHỎ — ≤ 430px
   ========================================================== */

@media screen and (max-width: 430px) {

    .worksheet-card-content {
        overflow: visible !important;
    }

    .worksheet-card h3,
    .worksheet-card-content h3 {
        width: 100% !important;

        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;

        margin: 0 0 2px 0 !important;
        padding: 2px 0 0 0 !important;

        font-size: 9.5px !important;
        line-height: 12px !important;
        font-weight: 900 !important;

        display: block !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;

        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;

        text-align: center !important;

        -webkit-font-smoothing: antialiased !important;
        -webkit-text-size-adjust: 100% !important;
    }
}