/* Shared certification layout. Keep certification styling outside PHP templates. */
body:has(.cert-student-shell),
body:has(.cert-exam-shell),
body:has(.cert-admin-shell),
body:has(.cert-teacher-shell) {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

body:has(.cert-student-shell) #main-content,
body:has(.cert-exam-shell) #main-content,
body:has(.cert-admin-shell) #main-content,
body:has(.cert-teacher-shell) main {
    flex: 1;
    min-height: 0
}

.site-footer {
    margin-top: auto
}

.cert-auth-shell {
    padding: 48px 0 76px
}

.cert-auth-intro {
    max-width: 720px
}

.cert-auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 28px
}

.cert-auth-card {
    padding: 26px;
    color: #edf3f4;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    box-shadow: 0 10px 26px #0003
}

.cert-auth-card h2 {
    margin: 0 0 10px
}

.cert-auth-card p {
    color: #b4c2c6;
    line-height: 1.6
}

.cert-auth-card label {
    display: block;
    margin: 16px 0 7px;
    color: #b4c2c6;
    font-weight: 700
}

.cert-auth-card input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #526871;
    border-radius: 8px;
    color: #edf3f4;
    background: #1b2b32;
    font: inherit
}

.cert-auth-card .button {
    margin-top: 18px
}

.cert-auth-card-narrow {
    max-width: 520px;
    margin-top: 28px;
}

.cert-auth-error,
.cert-auth-notice {
    max-width: 720px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border-left: 4px solid #e56722;
    color: #fff3cf;
    background: #493b29;
    border-radius: 6px;
}

.cert-auth-notice {
    border-left-color: #75d0a5;
    background: #234536;
}

.cert-admin-user-form {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 14px;
}

.cert-admin-user-form label {
    flex: 1;
    margin: 0;
}

.cert-admin-user-form .button {
    flex: 0 0 auto;
    margin: 0;
}

@media (max-width: 760px) {
    .cert-admin-user-form {
        display: block;
    }

    .cert-admin-user-form .button {
        margin-top: 10px;
    }
}

.cert-student-shell {
    padding: 52px 0 82px
}

.cert-student-card {
    max-width: 680px;
    margin: 28px auto 0;
    padding: clamp(24px, 5vw, 42px);
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    box-shadow: 0 10px 26px #0003
}

.cert-student-card h1 {
    margin-top: 0;
    color: red;
}

.cert-student-card p {
    color: #c4d0d3;
    line-height: 1.65
}

.cert-student-error {
    border-left: 4px solid #e56722
}

.cert-student-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px
}

.cert-student-card .button {
    margin-top: 0
}

.cert-type-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 7px;
    color: #182329;
    background: #f2c45f;
    font-size: .92rem;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: 0 2px 0 #9d7622
}

.cert-exam-shell {
    padding: 44px 0 80px
}

.cert-exam-intro {
    margin: 0 0 24px;
    color: #c4d0d3;
    line-height: 1.6
}

.cert-exam-question {
    margin: 0 0 18px;
    padding: 22px 24px;
    color: #edf3f4;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    box-shadow: 0 8px 20px #0003
}

.cert-exam-question h2 {
    margin: 0 0 16px;
    font-size: 1.08rem;
    line-height: 1.45
}

.cert-exam-question label {
    display: block;
    margin: 9px 0;
    padding: 11px 13px;
    color: #dce7e8;
    background: #30434b;
    border: 1px solid #526871;
    border-radius: 8px;
    cursor: pointer
}

.cert-exam-question label:hover {
    border-color: #e56722
}

.cert-exam-question input {
    margin-right: 8px;
    accent-color: #e56722
}

.cert-exam-submit {
    margin-top: 10px;
    padding: 14px 20px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #e56722;
    font: inherit;
    font-weight: 850;
    cursor: pointer
}

.cert-exam-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px
}

.cert-exam-timer {
    padding: 10px 14px;
    color: #fff;
    background: #17242b;
    border-radius: 8px;
    font-weight: 800;
    white-space: nowrap
}

.cert-exam-timer strong {
    margin-left: 8px;
    color: #ffad76
}

.cert-teacher-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 60px
}

.cert-teacher-intro {
    max-width: 720px;
    color: #3d3d3d;
    line-height: 1.6
}

.cert-teacher-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
    gap: 22px;
    margin-top: 28px
}

.cert-teacher-card {
    padding: 26px;
    color: #edf3f4;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    box-shadow: 0 10px 26px #0003;
    margin-top: 24px
}

.cert-teacher-card h2 {
    margin-top: 0
}

.cert-teacher-card label {
    display: block;
    margin: 16px 0 7px;
    color: #b4c2c6;
    font-weight: 700
}

.cert-teacher-card input,
.cert-teacher-card select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #526871;
    border-radius: 8px;
    color: #edf3f4;
    background: #1b2b32;
    font: inherit
}

.cert-teacher-card button,
.cert-teacher-card a.button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #e56722;
    font: inherit;
    font-weight: 800;
    text-decoration: none
}

.cert-teacher-table {
    margin-top: 22px;
    overflow-x: auto
}

.cert-teacher-table table {
    width: 100%;
    border-collapse: collapse
}

.cert-teacher-table th,
.cert-teacher-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #43565e;
    text-align: left;
    white-space: nowrap
}

.cert-teacher-table th {
    color: #b4c2c6;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em
}

.cert-teacher-notice {
    margin-top: 20px;
    padding: 14px 16px;
    color: #dce7e8;
    background: #2b3e46;
    border-left: 4px solid #e56722;
    border-radius: 6px
}

.cert-pin-card {
    margin-top: 0;
    text-align: center
}

.cert-qr-code {
    width: min(100%, 224px);
    margin: 20px auto;
}

.cert-qr-code svg {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    shape-rendering: crispEdges;
}

.cert-pin-label {
    margin: 0;
    color: #b4c2c6;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase
}

.cert-pin {
    margin: 12px 0;
    color: #ffad76;
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: .16em
}

.cert-admin-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 38px 0 64px
}

.cert-admin-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
    margin-top: 22px
}

.cert-admin-card,
.cert-admin-shell .card {
    padding: 24px;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    color: #edf3f4;
    box-shadow: 0 10px 26px #0003
}

.cert-admin-card h2,
.cert-admin-shell .card h2 {
    margin-top: 0
}

.cert-admin-card label,
.cert-admin-shell .card label {
    display: block;
    margin: 14px 0 6px;
    color: #b4c2c6;
    font-weight: 700
}

.cert-admin-card input,
.cert-admin-card select,
.cert-admin-card textarea,
.cert-admin-shell .card input,
.cert-admin-shell .card select,
.cert-admin-shell .card textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #526871;
    border-radius: 8px;
    color: #edf3f4;
    background: #1b2b32;
    font: inherit
}

.cert-admin-card textarea {
    min-height: 100px
}

.cert-admin-card button,
.cert-admin-card .button {
    display: inline-block;
    margin-top: 16px;
    padding: 11px 15px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #e56722;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer
}

.cert-admin-card .secondary {
    background: #344952
}

.question-bank-card {
    max-height: 640px;
    overflow: auto
}

.question-link {
    display: block;
    padding: 12px 0;
    color: #ffad76;
    border-bottom: 1px solid #43565e;
    text-decoration: none
}

.question-link.selected {
    padding-left: 12px;
    background: #344952;
    border-left: 4px solid #e56722
}

.cert-admin-card .danger {
    background: #493438
}

.cert-admin-type-card {
    margin-top: 22px
}

@media(max-width:760px) {

    .cert-auth-grid,
    .cert-admin-grid,
    .cert-teacher-grid {
        grid-template-columns: 1fr
    }

    .cert-teacher-grid > .cert-pin-card {
        order: -1
    }

    .cert-exam-head {
        align-items: flex-start;
        flex-direction: column
    }

    .cert-teacher-shell {
        width: min(100% - 30px, 1120px)
    }
}

/* Certification readability and result presentation. */
body:has(.cert-student-shell),
body:has(.cert-exam-shell),
body:has(.cert-result-shell),
body:has(.cert-admin-shell),
body:has(.cert-teacher-shell) {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

body:has(.cert-student-shell) #main-content,
body:has(.cert-exam-shell) #main-content,
body:has(.cert-result-shell) #main-content,
body:has(.cert-admin-shell) #main-content,
body:has(.cert-teacher-shell) main {
    flex: 1 0 auto;
    min-height: 0
}

.site-footer {
    margin-top: auto
}

.cert-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px
}

.cert-page-heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cert-user-label {
    color: #526871;
    font-size: .9rem;
    font-weight: 800;
}

.cert-page-heading-actions .cert-user-label {
    align-self: center;
    color: #526871;
}

.cert-user-label small {
    margin-left: 4px;
    color: #71838a;
    font-size: .82em;
    font-weight: 600;
}

.cert-page-heading h1 {
    margin-top: 0
}

.cert-student-name {
    padding: 10px 14px;
    color: #fff !important;
    background: #304b56 !important;
    border-left: 4px solid #eeb426
}

.cert-student-name strong {
    color: #fff !important
}

.cert-pin-recall {
    margin-top: 28px;
    padding: 14px 16px;
    display: grid;
    gap: 3px;
    color: #dce7e8;
    background: #1b2b32;
    border: 1px solid #526871;
    border-radius: 8px
}

.cert-pin-recall strong {
    color: #ffad76;
    font-size: 1.35rem;
    letter-spacing: .16em
}

.cert-pin-recall small {
    color: #b4c2c6
}

.cert-student-link {
    color: #ffad76;
    font-weight: 800
}

.cert-admin-shell {
    padding-bottom: 90px
}

.cert-admin-shell>section.cert-admin-card {
    display: inline-block;
    vertical-align: top;
    width: calc(50% - 12px);
    margin-top: 24px
}

.cert-admin-shell>section.cert-admin-card+section.cert-admin-card {
    margin-left: 18px
}

.cert-exam-intro,
.cert-exam-intro strong {
    color: #615e5e !important
}

.cert-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0
}

.cert-fact {
    padding: 14px 16px
}

.cert-fact strong,
.cert-fact span {
    display: block
}

.cert-fact strong {
    margin-bottom: 3px
}

.cert-exam-timer {
    position: fixed !important;
    top: 102px !important;
    right: max(16px, calc((100vw - 1160px)/2)) !important;
    z-index: 1000 !important;
    min-width: 152px;
    padding: 11px 14px;
    color: #fff;
    background: #0d2733;
    border: 2px solid #eeb426;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(4, 24, 31, .3);
    text-align: center
}

.cert-submit-warning {
    margin: 18px 0 4px;
    padding: 14px 16px;
    color: #fff3cf;
    background: #5b4525;
    border-left: 5px solid #eeb426;
    border-radius: 7px;
    font-weight: 700
}

.cert-submit-warning[hidden] {
    display: none
}

.cert-result-meta {
    color: #b4c2c6 !important
}

.cert-result-table {
    overflow-x: auto;
    margin: 24px 0
}

.cert-result-table table {
    width: 100%;
    border-collapse: collapse
}

.cert-result-table th,
.cert-result-table td {
    padding: 10px;
    border-bottom: 1px solid #526871;
    text-align: left;
    vertical-align: top
}

.cert-result-table th {
    color: #b4c2c6;
    font-size: .8rem;
    text-transform: uppercase
}

.cert-admin-shell a.button.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    color: #fff;
    background: #0d2733;
    border: 0;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 700
}

.cert-page-heading .button-secondary,
.cert-teacher-shell .button-secondary {
    color: #fff !important;
    background: #0d2733 !important;
    border: 0 !important
}

.button-danger {
    color: #fff !important;
    background: #93463d !important;
    border: 0
}

.button-small {
    padding: 7px 10px !important;
    margin: 0 !important;
    font-size: .82rem
}

@media(max-width:600px) {
    .cert-facts {
        grid-template-columns: 1fr
    }
}

@media(max-width:760px) {
    .cert-page-heading {
        flex-direction: column;
    }

    .cert-page-heading-actions {
        width: 100%;
    }
    .cert-admin-shell>section.cert-admin-card {
        display: block;
        width: 100%
    }

    .cert-admin-shell>section.cert-admin-card+section.cert-admin-card {
        margin-left: 0
    }

    .cert-exam-timer {
        top: 76px !important;
        right: 12px !important;
        min-width: 138px;
        padding: 9px 10px;
        font-size: .9rem
    }
}

.cert-student-name {
    padding: 10px 14px;
    color: #fff !important;
    background: #304b56;
    border-left: 4px solid #eeb426;
    border-radius: 6px;
}

.cert-student-name strong {
    color: #fff !important;
}

.cert-exam-timer {
    position: fixed;
    top: 102px;
    right: max(16px, calc((100vw - 1160px) / 2));
    z-index: 20;
    min-width: 152px;
    padding: 11px 14px;
    color: #fff;
    background: #0d2733;
    border: 2px solid #eeb426;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(4, 24, 31, .3);
    text-align: center;
}

.cert-submit-warning {
    margin: 18px 0 4px;
    padding: 14px 16px;
    color: #fff3cf;
    background: #5b4525;
    border-left: 5px solid #eeb426;
    border-radius: 7px;
    font-weight: 700;
}

.cert-submit-warning[hidden] {
    display: none;
}

.cert-time-warning {
    position: fixed;
    right: max(16px, calc((100vw - 1120px) / 2 - 180px));
    bottom: 16px;
    width: min(360px, calc(100vw - 32px));
    z-index: 1001;
    margin: 18px 0 4px;
    padding: 14px 16px;
    color: #fff3cf;
    background: #5b4525;
    border-left: 5px solid #eeb426;
    border-radius: 7px;
    box-shadow: 0 6px 18px rgba(4, 24, 31, .35);
    font-weight: 700;
}

.cert-time-warning[hidden] {
    display: none;
}

.cert-exam-timer.is-safe {
    color: #f3fff7 !important;
    background: #216346 !important;
    border-color: #8be0aa !important;
}

.cert-exam-timer.is-safe strong {
    color: #f3fff7;
}

.cert-exam-timer.is-warning {
    color: #fff8e8 !important;
    background: #79501d !important;
    border-color: #ffd166 !important;
}

.cert-exam-timer.is-warning strong {
    color: #fff8e8;
}

.cert-exam-timer.is-orange {
    color: #fff7f0 !important;
    background: #a34b1d !important;
    border-color: #ffb278 !important;
}

.cert-exam-timer.is-orange strong {
    color: #fff7f0;
}

.cert-exam-timer.is-critical {
    color: #fff5f2 !important;
    background: #87352d !important;
    border-color: #ffb4a8 !important;
}

.cert-exam-timer.is-critical strong {
    color: #fff5f2;
}

.cert-time-warning.is-warning {
    color: #fff8e8 !important;
    background: #79501d !important;
    border-left-color: #ffd166 !important;
}

.cert-time-warning.is-orange {
    color: #fff7f0 !important;
    background: #a34b1d !important;
    border-left-color: #ffb278 !important;
}

.cert-time-warning.is-critical {
    color: #fff5f2 !important;
    background: #87352d !important;
    border-left-color: #ffb4a8 !important;
}

body:has(.cert-exam-shell) #main-content,
body:has(.cert-student-shell) #main-content,
body:has(.cert-result-shell) #main-content,
body:has(.cert-admin-shell) #main-content {
    flex: 1 0 auto;
}

body:has(.cert-exam-shell) .site-footer,
body:has(.cert-student-shell) .site-footer,
body:has(.cert-result-shell) .site-footer,
body:has(.cert-admin-shell) .site-footer {
    margin-top: auto;
}

@media (max-width: 760px) {
    .cert-exam-timer {
        top: 76px;
        right: 12px;
        min-width: 138px;
        padding: 9px 10px;
        font-size: .9rem;
    }

    .cert-time-warning {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: auto;
        margin: 0;
        pointer-events: none;
    }
}

.cert-student-card,
.cert-exam-question,
.cert-admin-card,
.cert-teacher-card {
    color: #f4f7f8
}

.cert-student-card p,
.cert-student-card li,
.cert-exam-intro {
    color: #d8e2e4
}

.cert-type-badge {
    padding: 0 0 5px;
    border-radius: 0;
    color: #f2c45f;
    background: transparent;
    border-bottom: 3px solid #e56722;
    box-shadow: none;
    font-size: 1rem;
}

.cert-student-name {
    display: block;
    margin-top: 8px;
    color: #fff !important;
    font-size: 1.25rem
}

.cert-student-name strong {
    color: #fff !important
}

@media (min-width: 761px) {
    .cert-exam-timer {
        position: fixed !important;
        top: 102px !important;
        right: max(15px, calc((100vw - 1120px) / 2 - 180px)) !important;
        z-index: 1000 !important;
    }
}

.cert-result-shell {
    padding: 52px 0 82px
}

.cert-result-card {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 42px);
    color: #edf3f4;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 14px;
    box-shadow: 0 10px 26px #0003
}
@media (min-width: 761px) {
    .cert-result-shell > .shell {
        width: min(1600px, calc(100% - 48px));
    }

    .cert-result-card {
        max-width: none;
    }
}

.cert-result-card p {
    color: #d8e2e4;
    line-height: 1.65
}

.cert-result-score {
    font-size: 2rem;
    color: #75d0a5
}

.cert-result-warning {
    margin-top: 20px;
    padding: 14px 16px;
    color: #ffe2aa;
    background: #493b29;
    border-left: 4px solid #e4b05d;
    border-radius: 6px
}

.cert-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px
}

.result-status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.result-status-correct {
    color: #c9f4dc;
    background: #216344;
}

.result-status-wrong {
    color: #ffd8d2;
    background: #743b37;
}

.result-status-unanswered {
    color: #ffe9ae;
    background: #665126;
}

.cert-teacher-mobile-list,
.cert-result-mobile-list {
    display: none;
}

.cert-assignment-accordion,
.cert-question-accordion {
    border: 1px solid #526871;
    border-radius: 9px;
    background: #1b2b32;
}

.cert-assignment-accordion + .cert-assignment-accordion,
.cert-question-accordion + .cert-question-accordion {
    margin-top: 12px;
}

.cert-assignment-accordion summary,
.cert-question-accordion summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 24px;
    gap: 10px;
    align-items: center;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
}

.cert-question-accordion summary {
    grid-template-columns: minmax(0, 1fr) auto 24px;
}

.cert-assignment-accordion summary::-webkit-details-marker,
.cert-question-accordion summary::-webkit-details-marker {
    display: none;
}

.cert-assignment-accordion summary::after,
.cert-question-accordion summary::after {
    content: '＋';
    color: #f2c45f;
    font-size: 1.2rem;
    font-weight: 400;
}

.cert-assignment-accordion[open] summary::after,
.cert-question-accordion[open] summary::after {
    content: '−';
}

.cert-assignment-summary-main,
.cert-question-summary-number {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cert-assignment-summary-main strong {
    overflow-wrap: anywhere;
}

.cert-assignment-summary-main small {
    color: #b4c2c6;
    overflow-wrap: anywhere;
}

.cert-assignment-summary-status {
    color: #f2c45f;
    font-size: .78rem;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.cert-assignment-summary-result {
    color: #d8e2e4;
    font-size: .82rem;
    white-space: nowrap;
}

.cert-assignment-details,
.cert-question-details {
    padding: 0 14px 14px;
    border-top: 1px solid #43565e;
}

.cert-assignment-details dl,
.cert-question-details dl {
    margin: 0;
}

.cert-assignment-details dl div,
.cert-question-details dl div {
    display: grid;
    grid-template-columns: minmax(105px, 35%) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(82, 104, 113, .55);
}

.cert-assignment-details dt,
.cert-question-details dt {
    color: #b4c2c6;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cert-assignment-details dd,
.cert-question-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cert-assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cert-assignment-actions form {
    margin: 0;
}

.cert-question-summary-number {
    font-weight: 800;
}

.cert-question-summary-status {
    white-space: nowrap;
}

.cert-question-text {
    margin: 14px 0 8px;
    color: #f4f7f8 !important;
    font-weight: 700;
}

@media (max-width: 760px) {
    .cert-teacher-table,
    .cert-result-table {
        display: none;
    }

    .cert-teacher-mobile-list,
    .cert-result-mobile-list {
        display: block;
        margin-top: 22px;
    }

    .cert-teacher-table,
    .cert-result-table {
        overflow: visible;
    }

    .cert-teacher-table table,
    .cert-result-table table {
        display: block;
    }

    .cert-teacher-table thead,
    .cert-result-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .cert-teacher-table tbody,
    .cert-result-table tbody,
    .cert-teacher-table tr,
    .cert-result-table tr {
        display: block;
    }

    .cert-teacher-table tr,
    .cert-result-table tr {
        margin-bottom: 16px;
        padding: 12px 14px;
        border: 1px solid #526871;
        border-radius: 9px;
        background: #1b2b32;
    }

    .cert-teacher-table td,
    .cert-result-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        width: 100%;
        padding: 9px 0;
        border-bottom: 1px solid rgba(82, 104, 113, .55);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .cert-teacher-table td::before,
    .cert-result-table td::before {
        content: attr(data-label);
        color: #b4c2c6;
        font-size: .74rem;
        font-weight: 800;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .cert-teacher-table td:last-child,
    .cert-result-table td:last-child {
        border-bottom: 0;
    }

    .cert-teacher-table td:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .cert-teacher-table td:last-child::before {
        width: 100%;
    }

    .cert-teacher-table td:last-child form {
        margin: 0;
    }

    .cert-result-table td:first-child,
    .cert-result-table td:nth-child(2) {
        display: block;
    }

    .cert-result-table td:first-child::before,
    .cert-result-table td:nth-child(2)::before {
        display: block;
        margin-bottom: 4px;
    }

    .cert-result-table td:first-child {
        color: #f2c45f;
        font-weight: 800;
    }
}

/* Certadmin dashboard layout */
.cert-admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #c8d2d4;
}

.cert-admin-header h1 {
    margin: 0 0 6px;
}

.cert-admin-header .eyebrow,
.cert-admin-header .cert-user-label {
    margin: 0;
}

.cert-admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.cert-admin-header-actions .button {
    margin: 0;
}

.cert-admin-notice {
    margin: 0 0 20px;
    padding: 13px 16px;
    color: #234536;
    background: #e5f3eb;
    border-left: 4px solid #4b9c72;
    border-radius: 7px;
    font-weight: 700;
}

.cert-admin-toolbar {
    margin-bottom: 22px;
    padding: 18px 20px;
    background: #263840;
    border: 1px solid #43565e;
    border-radius: 12px;
    color: #edf3f4;
}

.cert-admin-toolbar form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
}

.cert-admin-toolbar label {
    margin: 0;
    color: #b4c2c6;
    font-weight: 700;
}

.cert-admin-toolbar select {
    width: 100%;
    padding: 11px;
    border: 1px solid #526871;
    border-radius: 8px;
    color: #edf3f4;
    background: #1b2b32;
    font: inherit;
}

.cert-admin-toolbar button {
    display: inline-block;
    padding: 11px 15px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #e56722;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.cert-admin-management-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.cert-admin-management-grid .cert-admin-card {
    width: auto;
    margin: 0;
}

.cert-admin-shell > section.cert-admin-card {
    display: block;
    width: auto;
    margin: 22px 0 0;
}

@media (max-width: 900px) {
    .cert-admin-management-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .cert-admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cert-admin-header-actions {
        justify-content: flex-start;
    }

    .cert-admin-toolbar form {
        grid-template-columns: 1fr;
    }

    .cert-admin-toolbar button {
        width: 100%;
    }

    .cert-admin-management-grid {
        grid-template-columns: 1fr;
    }
}
