.notice-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.notice-page-head p {
    margin: 8px 0 0;
    color: #667085;
}

.notice-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.notice-admin-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfe7f2;
    border-radius: 20px;
    background: #fff;
}

.notice-admin-image {
    height: 210px;
    overflow: hidden;
    background: #edf2f8;
}

.notice-admin-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notice-admin-body {
    padding: 22px;
}

.notice-admin-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.notice-badge {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.notice-badge.published {
    color: #198754;
    background: #e8f8ee;
}

.notice-badge.disabled {
    color: #667085;
    background: #eef1f5;
}

.notice-badge.popup {
    color: #1769d2;
    background: #e9f3ff;
}

.notice-badge.emergency {
    color: #d92d20;
    background: #ffe9e9;
}

.notice-admin-card h2 {
    margin: 14px 0 0;
    font-size: 21px;
}

.notice-admin-preview {
    min-height: 48px;
    margin: 9px 0 0;
    color: #667085;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.notice-admin-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0 0;
}

.notice-admin-meta div {
    padding: 12px;
    border-radius: 12px;
    background: #f7f9fc;
}

.notice-admin-meta dt {
    color: #7a879c;
    font-size: 12px;
}

.notice-admin-meta dd {
    margin: 5px 0 0;
    font-weight: 800;
}

.notice-admin-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.notice-admin-actions form,
.notice-admin-actions .btn {
    width: 100%;
}

.notice-empty {
    grid-column: 1 / -1;
}

.notice-modal[hidden] {
    display: none;
}

.notice-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.notice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 52, .6);
}

.notice-modal-dialog {
    position: relative;
    width: min(780px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px;
    border-radius: 22px;
    background: #fff;
}

.notice-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.notice-modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #eef2f7;
    font-size: 24px;
    cursor: pointer;
}

.notice-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.notice-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 13px;
    border: 1px solid #dfe7f2;
    border-radius: 12px;
}

.notice-check input {
    width: auto !important;
    margin: 0 !important;
}

.notice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.emergency-notice-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 13px 20px;
    color: #fff;
    background: linear-gradient(90deg, #d92d20, #ef4444);
}

.emergency-notice-bar strong {
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(255,255,255,.16);
    font-size: 12px;
}

.emergency-notice-bar em {
    font-style: normal;
    font-size: 12px;
    text-decoration: underline;
}

.notice-popup-open {
    overflow: hidden;
}

.notice-popup-layer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 18, 35, .62);
}

.notice-popup-layer[hidden] {
    display: none;
}

.notice-popup-card {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0,0,0,.28);
}

.notice-popup-card[hidden] {
    display: none;
}

.notice-popup-close {
    position: sticky;
    top: 14px;
    z-index: 3;
    display: block;
    margin: 14px 14px -38px auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #13213b;
    background: rgba(255,255,255,.9);
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    font-size: 23px;
    cursor: pointer;
}

.notice-popup-image {
    overflow: hidden;
    background: #edf2f8;
}

.notice-popup-image img {
    display: block;
    width: 100%;
    height: auto;
}

.notice-popup-content {
    padding: 28px;
}

.notice-popup-label {
    color: #3775f5;
    font-size: 12px;
    font-weight: 900;
}

.notice-popup-content h2 {
    margin: 8px 0 0;
    font-size: 27px;
}

.notice-popup-text {
    max-height: 240px;
    overflow-y: auto;
    margin: 16px 0 22px;
    color: #475467;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.notice-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    color: #667085;
    font-size: 13px;
}

.notice-popup-footer label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notice-list-item {
    display: flex;
    gap: 20px;
    padding: 22px;
    border: 1px solid #e3eaf4;
    border-radius: 18px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.notice-list-item:hover {
    border-color: #b9cdf3;
    box-shadow: 0 10px 24px rgba(20, 39, 73, .08);
}

.notice-list-thumb {
    flex: none;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f7fc;
}

.notice-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notice-list-body {
    flex: 1;
    min-width: 0;
}

.notice-list-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-list-title-row h2 {
    margin: 0;
    font-size: 18px;
}

.notice-list-preview {
    margin: 8px 0 0;
    color: #667085;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-list-meta {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    color: #98a2b3;
    font-size: 13px;
}

@media (max-width: 620px) {
    .notice-list-thumb {
        display: none;
    }
}

.notice-detail-card {
    padding: 30px;
    border: 1px solid #dfe7f2;
    border-radius: 22px;
    background: #fff;
}

.notice-detail-image {
    display: block;
    max-width: 100%;
    max-height: 480px;
    margin: 0 auto 26px;
    border-radius: 16px;
    object-fit: contain;
}

.notice-detail-content {
    margin-bottom: 24px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}
/* =========================================================
   공지 작성/수정 모달 정리
========================================================= */

.notice-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.notice-modal[hidden] {
    display: none;
}

.notice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 29, 53, 0.58);
    backdrop-filter: blur(3px);
}

.notice-modal-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 30px;
    border: 1px solid #dfe7f2;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(15, 29, 53, 0.24);
}

.notice-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5ebf4;
}

.notice-modal-head h2 {
    margin: 0;
    color: #11213d;
    font-size: 26px;
    line-height: 1.3;
}

.notice-modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #11213d;
    background: #eef2f7;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.notice-modal-close:hover {
    background: #e3e9f1;
}

/* 폼 전체 */

.notice-modal form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.notice-modal form > label,
.notice-modal .form-grid > label {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    margin: 0;
    color: #24324b;
    font-size: 14px;
    font-weight: 800;
}

.notice-modal input[type="text"],
.notice-modal input[type="url"],
.notice-modal input[type="number"],
.notice-modal input[type="datetime-local"],
.notice-modal input[type="file"],
.notice-modal textarea,
.notice-modal select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid #d9e2ef;
    border-radius: 12px;
    outline: none;
    color: #11213d;
    background: #ffffff;
    font: inherit;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.notice-modal input:focus,
.notice-modal textarea:focus,
.notice-modal select:focus {
    border-color: #6f9df8;
    box-shadow: 0 0 0 4px rgba(55, 117, 245, 0.11);
}

.notice-modal textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.7;
}

.notice-modal input[type="file"] {
    padding: 10px;
    background: #f8faff;
}

.notice-modal label small {
    color: #7a879c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

/* 2열 입력 */

.notice-modal .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* 체크 옵션 */

.notice-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.notice-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px !important;
    min-height: 54px;
    padding: 14px 15px;
    border: 1px solid #dfe7f2;
    border-radius: 14px;
    color: #344054 !important;
    background: #f9fbfe;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.notice-check:hover {
    border-color: #b9cdf1;
    background: #f4f8ff;
}

.notice-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px;
    margin: 0 !important;
    accent-color: #3775f5;
}

/* 버튼 */

.notice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid #e5ebf4;
}

.notice-modal-actions .btn {
    min-width: 96px;
}

/* 스크롤바 */

.notice-modal-dialog::-webkit-scrollbar {
    width: 9px;
}

.notice-modal-dialog::-webkit-scrollbar-thumb {
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #c8d3e2;
}

.notice-modal-dialog::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 720px) {
    .notice-modal {
        padding: 12px;
    }

    .notice-modal-dialog {
        max-height: calc(100vh - 24px);
        padding: 22px 18px;
        border-radius: 19px;
    }

    .notice-modal-head h2 {
        font-size: 22px;
    }

    .notice-modal .form-grid,
    .notice-check-grid {
        grid-template-columns: 1fr;
    }

    .notice-modal-actions {
        flex-direction: column-reverse;
    }

    .notice-modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .notice-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .notice-admin-grid,
    .notice-check-grid {
        grid-template-columns: 1fr;
    }

    .notice-admin-actions {
        grid-template-columns: 1fr;
    }

    .emergency-notice-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}
.notice-modal .notice-modal-dialog {
    width: min(780px, calc(100vw - 40px)) !important;
    padding: 28px !important;
    box-sizing: border-box !important;
}

.notice-modal .notice-modal-dialog form {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    width: 100% !important;
}

.notice-modal .notice-modal-dialog form > label {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    color: #24324b !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.notice-modal .notice-modal-dialog input:not([type="checkbox"]):not([type="radio"]),
.notice-modal .notice-modal-dialog textarea,
.notice-modal .notice-modal-dialog select {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 13px 14px !important;
    border: 1px solid #d9e2ef !important;
    border-radius: 12px !important;
    color: #11213d !important;
    background: #fff !important;
    font-size: 14px !important;
}

.notice-modal .notice-modal-dialog textarea {
    min-height: 190px !important;
    resize: vertical !important;
    line-height: 1.7 !important;
}

.notice-modal .notice-modal-dialog input[type="file"] {
    padding: 10px !important;
    background: #f8faff !important;
}

.notice-modal .form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
}

.notice-modal .form-grid > label {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.notice-modal .notice-check-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
}

.notice-modal .notice-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 56px !important;
    padding: 14px 15px !important;
    margin: 0 !important;
    border: 1px solid #dfe7f2 !important;
    border-radius: 14px !important;
    background: #f8fbff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
}

.notice-modal .notice-check input[type="checkbox"] {
    display: block !important;
    flex: 0 0 auto !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #3775f5 !important;
}

.notice-modal .notice-modal-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 4px !important;
    padding-top: 20px !important;
    border-top: 1px solid #e5ebf4 !important;
}

.notice-modal .notice-modal-actions .btn {
    width: auto !important;
    min-width: 96px !important;
}

.notice-modal .notice-modal-dialog input:focus,
.notice-modal .notice-modal-dialog textarea:focus,
.notice-modal .notice-modal-dialog select:focus {
    outline: none !important;
    border-color: #6f9df8 !important;
    box-shadow: 0 0 0 4px rgba(55, 117, 245, 0.11) !important;
}

/* 공지 모달 내부 폼 최종 강제 정렬 */
#notice-create-modal .notice-modal-dialog form,
#notice-edit-modal .notice-modal-dialog form {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    width: 100% !important;
}

/* 제목, 내용, 이미지, 링크를 세로로 정렬 */
#notice-create-modal .notice-modal-dialog form > label,
#notice-edit-modal .notice-modal-dialog form > label {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    color: #24324b !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* 모든 입력창 전체 폭 */
#notice-create-modal input:not([type="checkbox"]),
#notice-create-modal textarea,
#notice-create-modal select,
#notice-edit-modal input:not([type="checkbox"]),
#notice-edit-modal textarea,
#notice-edit-modal select {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 13px 14px !important;
    border: 1px solid #d9e2ef !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #11213d !important;
    font-size: 14px !important;
}

#notice-create-modal textarea,
#notice-edit-modal textarea {
    min-height: 190px !important;
    resize: vertical !important;
    line-height: 1.7 !important;
}

/* 파일 업로드 */
#notice-create-modal input[type="file"],
#notice-edit-modal input[type="file"] {
    padding: 10px !important;
    background: #f8faff !important;
}

/* 시작·종료·우선순위·게시상태 */
#notice-create-modal .form-grid,
#notice-edit-modal .form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
}

#notice-create-modal .form-grid > label,
#notice-edit-modal .form-grid > label {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* 체크박스 카드 */
#notice-create-modal .notice-check-grid,
#notice-edit-modal .notice-check-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
}

#notice-create-modal .notice-check,
#notice-edit-modal .notice-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 56px !important;
    padding: 14px 15px !important;
    margin: 0 !important;
    border: 1px solid #dfe7f2 !important;
    border-radius: 14px !important;
    background: #f8fbff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

#notice-create-modal .notice-check input[type="checkbox"],
#notice-edit-modal .notice-check input[type="checkbox"] {
    flex: 0 0 auto !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#notice-create-modal .notice-modal-actions,
#notice-edit-modal .notice-modal-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 20px !important;
    border-top: 1px solid #e5ebf4 !important;
}

@media (max-width: 720px) {
    #notice-create-modal .form-grid,
    #notice-create-modal .notice-check-grid,
    #notice-edit-modal .form-grid,
    #notice-edit-modal .notice-check-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 720px) {
    .notice-modal .notice-modal-dialog {
        width: calc(100vw - 24px) !important;
        padding: 20px 16px !important;
    }

    .notice-modal .form-grid,
    .notice-modal .notice-check-grid {
        grid-template-columns: 1fr !important;
    }

    .notice-modal .notice-modal-actions {
        flex-direction: column-reverse !important;
    }

    .notice-modal .notice-modal-actions .btn {
        width: 100% !important;
    }
}
