.banner-admin-panel {
    margin-top: 16px;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--student-line);
    border-radius: 8px;
}

.banner-admin-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.banner-admin-heading h2 {
    margin: 0;
    color: #102d51;
    font-size: 1.3rem;
}

.banner-admin-heading p:not(.student-kicker) {
    margin: 7px 0 0;
    color: var(--student-muted);
    font-size: .72rem;
}

.banner-count {
    flex: 0 0 auto;
    padding: 8px 11px;
    color: #0b3b6d;
    background: #e8f1fb;
    border-radius: 4px;
    font-size: .66rem;
    font-weight: 800;
}

.banner-size-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 13px 15px;
    gap: 18px;
    color: #493b00;
    background: #fff8d5;
    border-left: 4px solid var(--student-gold);
    font-size: .66rem;
}

.banner-size-guide strong,
.banner-size-guide span {
    display: block;
}

.banner-add-box {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-radius: 6px;
}

.banner-add-box summary {
    padding: 14px 16px;
    color: #0b3b6d;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
}

.banner-add-box[open] summary {
    border-bottom: 1px solid var(--student-line);
}

.banner-add-box .banner-form {
    padding: 18px;
}

.banner-editor-list {
    display: grid;
    margin-top: 16px;
    gap: 14px;
}

.banner-editor-card {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--student-line);
    border-radius: 7px;
}

.banner-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 2;
    min-height: 0;
    align-self: start;
    overflow: hidden;
    background: #e8eef5;
    border-right: 1px solid var(--student-line);
    border-bottom: 1px solid var(--student-line);
}

.banner-preview img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.banner-preview > span {
    position: absolute;
    top: 12px;
    left: 12px;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: #102d51;
    background: var(--student-gold);
    border-radius: 50%;
    font-size: .68rem;
    font-weight: 800;
}

.banner-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 18px;
    gap: 12px;
}

.banner-form label {
    display: block;
    min-width: 0;
}

.banner-form label > span {
    display: block;
    margin-bottom: 6px;
    color: #334a65;
    font-size: .61rem;
    font-weight: 700;
}

.banner-form input[type="text"],
.banner-form input[type="file"],
.banner-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    color: #102d51;
    background: #fff;
    border: 1px solid #bac7d5;
    border-radius: 4px;
    font: inherit;
    font-size: .68rem;
}

.banner-form textarea {
    resize: vertical;
    line-height: 1.5;
}

.banner-field-wide {
    grid-column: 1 / -1;
}

.banner-active-field {
    display: flex !important;
    align-items: center;
    padding: 9px 11px;
    gap: 8px;
    background: #edf7f2;
    border-radius: 4px;
}

.banner-active-field input {
    width: 17px;
    height: 17px;
    accent-color: #16845d;
}

.banner-active-field span {
    margin: 0 !important;
    color: #075e42 !important;
}

.banner-form-submit {
    display: flex;
    justify-content: flex-end;
}

.banner-editor-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    gap: 7px;
    background: #f5f8fb;
    border-top: 1px solid var(--student-line);
}

.banner-editor-actions form {
    margin: 0;
}

.banner-delete-button {
    background: #c71f2a;
}

.youtube-admin-panel {
    margin-top: 16px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-top: 4px solid #d71920;
    border-radius: 8px;
}

.youtube-admin-panel h2 {
    margin: 0;
    color: #102d51;
    font-size: 1.3rem;
}

.youtube-admin-panel .banner-admin-heading p:not(.student-kicker) {
    margin: 7px 0 0;
    color: var(--student-muted);
    font-size: .72rem;
}

.youtube-count {
    flex: 0 0 auto;
    padding: 8px 11px;
    color: #8c1820;
    background: #fff0f1;
    border-radius: 4px;
    font-size: .66rem;
    font-weight: 800;
}

.youtube-add-form {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.3fr) auto;
    align-items: end;
    margin-top: 18px;
    padding: 16px;
    gap: 10px;
    background: #f7f9fc;
    border: 1px solid var(--student-line);
    border-radius: 6px;
}

.youtube-add-form label,
.youtube-admin-card form label {
    display: block;
}

.youtube-add-form label span,
.youtube-admin-card form label span {
    display: block;
    margin-bottom: 6px;
    color: #334a65;
    font-size: .61rem;
    font-weight: 700;
}

.youtube-add-form input,
.youtube-admin-card form input {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    color: #102d51;
    background: #fff;
    border: 1px solid #bac7d5;
    border-radius: 4px;
    font: inherit;
    font-size: .68rem;
}

.youtube-admin-list {
    display: grid;
    margin-top: 14px;
    gap: 10px;
}

.youtube-admin-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px;
    gap: 13px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-radius: 6px;
}

.youtube-admin-card > img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #0b2f59;
    border-radius: 4px;
}

.youtube-admin-card > form {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 9px;
}

.youtube-admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.youtube-admin-actions form {
    margin: 0;
}

.youtube-admin-empty {
    margin-top: 14px;
    padding: 25px;
    color: #64748b;
    text-align: center;
    background: #f7f9fc;
    border: 1px dashed #bcc9d7;
    border-radius: 6px;
    font-size: .68rem;
}

@media (max-width: 850px) {
    .banner-editor-card {
        grid-template-columns: 1fr;
    }

    .banner-preview,
    .banner-preview img {
        min-height: 0;
        max-height: none;
    }

    .banner-preview {
        width: min(100%, 520px);
        border-right: 0;
    }

    .youtube-add-form,
    .youtube-admin-card {
        grid-template-columns: 1fr;
    }

    .youtube-admin-card > img {
        max-width: 330px;
    }

    .youtube-admin-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .banner-admin-panel {
        padding: 16px;
    }

    .banner-admin-heading,
    .banner-size-guide {
        align-items: flex-start;
        flex-direction: column;
    }

    .banner-form {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .banner-field-wide {
        grid-column: auto;
    }

    .banner-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .banner-editor-actions form,
    .banner-editor-actions button {
        width: 100%;
    }

    .youtube-admin-panel {
        padding: 16px;
    }

    .youtube-admin-card > form {
        grid-template-columns: 1fr;
    }

    .youtube-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .youtube-admin-actions form,
    .youtube-admin-actions button {
        width: 100%;
    }
}

/* Pengurusan menu header */
.header-menu-admin-panel {
    margin-top: 26px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-top: 5px solid #103d69;
}

.header-menu-count {
    padding: 7px 10px;
    color: #103d69;
    background: #eaf1f7;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 800;
}

.header-menu-form {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr 1.1fr 110px auto;
    align-items: end;
    padding: 16px;
    gap: 12px;
}

.header-menu-form label {
    display: grid;
    gap: 6px;
}

.header-menu-form label > span {
    color: #364b65;
    font-size: .72rem;
    font-weight: 700;
}

.header-menu-form input,
.header-menu-form select {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #bac9d8;
    border-radius: 4px;
    font: inherit;
}

.header-menu-editor-list {
    display: grid;
    margin-top: 18px;
    gap: 8px;
}

.header-menu-editor {
    margin-left: calc((var(--menu-depth) - 1) * 22px);
    background: #f8fafc;
    border: 1px solid #d5e0eb;
    border-left: 4px solid #174b91;
    border-radius: 6px;
}

.header-menu-editor > summary {
    display: grid;
    grid-template-columns: 66px minmax(150px, .8fr) minmax(180px, 1.2fr);
    align-items: center;
    min-height: 48px;
    padding: 8px 14px;
    cursor: pointer;
    list-style: none;
    gap: 10px;
}

.header-menu-editor > summary::-webkit-details-marker {
    display: none;
}

.header-menu-editor > summary::after {
    justify-self: end;
    content: "▾";
}

.header-menu-editor[open] > summary::after {
    transform: rotate(180deg);
}

.header-menu-level {
    padding: 4px 7px;
    color: #103d69;
    background: #e7eff8;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 800;
    text-align: center;
}

.header-menu-editor summary small {
    overflow: hidden;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-menu-delete {
    display: flex;
    justify-content: flex-end;
    padding: 0 16px 16px;
}

/* Semua panel Admin ditutup secara lalai */
.admin-master-panel {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-radius: 8px;
    overflow: hidden;
}

.admin-master-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 12px 20px;
    color: #fff;
    background: #103d69;
    border-bottom: 4px solid #ffd100;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.admin-master-panel > summary::-webkit-details-marker {
    display: none;
}

.admin-master-panel > summary::after {
    content: "＋";
}

.admin-master-panel[open] > summary::after {
    content: "−";
}

.admin-master-panel > section {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.admin-panel-controls {
    display: flex;
    justify-content: flex-end;
    margin: 14px 0 4px;
    gap: 8px;
}

@media (max-width: 850px) {
    .header-menu-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .header-menu-admin-panel {
        padding: 18px;
    }

    .header-menu-form {
        grid-template-columns: 1fr;
    }

    .header-menu-editor {
        margin-left: calc((var(--menu-depth) - 1) * 8px);
    }

    .header-menu-editor > summary {
        grid-template-columns: 62px 1fr;
    }

    .header-menu-editor summary small {
        display: none;
    }
}

/* Tajuk seksyen laman utama */
.site-title-admin-panel {
    padding: 26px;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-top: 5px solid #103d69;
    border-radius: 8px;
}

.site-title-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
    gap: 13px;
}

.site-title-form label {
    display: grid;
    gap: 6px;
}

.site-title-form label span {
    color: #364b65;
    font-size: .72rem;
    font-weight: 700;
}

.site-title-form input {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    background: #fff;
    border: 1px solid #bac9d8;
    border-radius: 4px;
    font: inherit;
}

.site-title-submit {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 3px;
}

@media (max-width: 850px) {
    .site-title-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .site-title-admin-panel {
        padding: 18px;
    }

    .site-title-form {
        grid-template-columns: 1fr;
    }

    .site-title-submit {
        grid-column: auto;
    }

    .site-title-submit .student-button {
        width: 100%;
    }
}

/* Panel butang pautan bergambar */
.quick-link-admin-panel {
    padding: 28px;
    margin-top: 26px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-top: 5px solid #103d69;
}

.quick-link-count {
    padding: 7px 10px;
    color: #103d69;
    background: #eaf1f7;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 800;
}

.quick-link-size-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin: 18px 0;
    color: #4c421d;
    background: #fff7d2;
    border-left: 4px solid #ffd100;
    gap: 16px;
}

.quick-link-size-guide strong,
.quick-link-size-guide span {
    font-size: .72rem;
}

.quick-link-add-form {
    padding: 18px;
}

.quick-link-editor-list {
    display: grid;
    margin-top: 18px;
    gap: 14px;
}

.quick-link-editor-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--student-line);
}

.quick-link-preview {
    display: grid;
    min-height: 150px;
    padding: 12px;
    color: #fff;
    background: #103d69;
    place-items: center;
}

.quick-link-preview img {
    display: block;
    width: 190px;
    height: 57px;
    object-fit: cover;
    background: #fff;
    border-radius: 4px;
}

.quick-link-preview span {
    display: grid;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, .13);
    border: 2px solid #ffd100;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 800;
    place-items: center;
}

.quick-link-preview-auto svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick-link-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    padding: 16px;
    gap: 12px;
}

.quick-link-form label {
    display: grid;
    gap: 6px;
}

.quick-link-form label > span {
    color: #364b65;
    font-size: .72rem;
    font-weight: 700;
}

.quick-link-form input[type="text"],
.quick-link-form input[type="url"],
.quick-link-form input[type="file"] {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #bac9d8;
    border-radius: 3px;
    font: inherit;
}

.quick-link-active {
    display: flex !important;
    grid-column: 1 / -1;
    align-items: center;
    padding: 10px 12px;
    background: #e8f5ef;
    gap: 9px;
}

.quick-link-editor-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding: 11px 16px;
    background: #fff;
    border-top: 1px solid var(--student-line);
    gap: 8px;
}

.quick-link-editor-actions form {
    margin: 0;
}

@media (max-width: 850px) {
    .quick-link-form {
        grid-template-columns: 1fr;
    }

    .quick-link-active {
        grid-column: auto;
    }
}

@media (max-width: 620px) {
    .quick-link-admin-panel {
        padding: 18px;
    }

    .quick-link-size-guide {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-link-editor-card {
        grid-template-columns: 1fr;
    }

    .quick-link-preview {
        min-height: 110px;
    }

    .quick-link-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-link-editor-actions form,
    .quick-link-editor-actions button {
        width: 100%;
    }
}
