.admin-body {
    background-color: var(--bg-creme, #F7F5F0);
    min-height: 100vh;
    color: var(--text-main, #2B2620);
    font-family: var(--font-sans, 'Pretendard', sans-serif);
}

.admin-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* =========================================
   상단 메인 헤더
========================================= */
.admin-header-box {
    text-align: center;
    margin-bottom: 28px;
}

.header-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2.5px;
    color: var(--accent-brown, #B89065);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.admin-main-title {
    font-family: var(--font-serif-kr, serif);
    font-size: 25px;
    font-weight: 500;
    color: var(--text-main, #2B2620);
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.admin-main-desc {
    font-size: 13.5px;
    color: var(--text-sub, #7A7269);
    line-height: 1.6;
    word-break: keep-all;
    margin: 0;
}

/* =========================================
   ⭐️ 4단 대분류 탭 네비게이션
========================================= */
.admin-main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: #EAE6DF;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.main-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub, #7A7269);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.main-tab-btn:hover {
    color: var(--text-main, #2B2620);
}

.main-tab-btn.active {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-tab-badge {
    background: rgba(43, 38, 32, 0.08);
    color: var(--text-sub, #7A7269);
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.main-tab-btn.active .main-tab-badge {
    background: #F0ECE6;
    color: var(--text-main, #2B2620);
}

/* 검수 대기 항목이 1개 이상 있을 때 강조색 표시 */
.main-tab-badge.has-items {
    background: var(--accent-brown, #B89065) !important;
    color: #FFFFFF !important;
}

/* =========================================
   패널 전환 (선택된 탭만 노출)
========================================= */
.admin-tab-panel {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.admin-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-desc-box {
    text-align: center;
    margin-bottom: 20px;
}

.panel-sub-desc {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    line-height: 1.5;
    margin: 0;
    word-break: keep-all;
}

/* =========================================
   1. 검수 탭: 상태 서브 필터 & 카드 목록
========================================= */
.filter-tabs {
    display: flex;
    gap: 8px;
    background: #F2EFE9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-sub, #7A7269);
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.filter-tab.active {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.badge {
    background: rgba(0, 0, 0, 0.06);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
}

.filter-tab.active .badge {
    background: var(--accent-brown, #B89065);
    color: #FFFFFF;
}

.memory-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.archive-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.card-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #F0EEE9;
    padding-bottom: 10px;
    gap: 12px;
}

.sender-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sender-name {
    font-size: 14.5px;
    font-weight: 600;
}

.sender-relation {
    font-size: 11.5px;
    background: #F4EFEA;
    color: var(--accent-brown, #B89065);
    padding: 2px 7px;
    border-radius: 8px;
}

.submit-date {
    font-size: 11.5px;
    color: #A0988F;
    margin-left: 2px;
}

.media-preview-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.media-thumbnail {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #EAE7E1;
    cursor: pointer;
    user-select: none;
}

.media-thumbnail img,
.media-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.25s ease, opacity 0.25s ease;
}

.media-thumbnail.excluded img,
.media-thumbnail.excluded video {
    filter: grayscale(100%);
    opacity: 0.35;
}

.btn-toggle-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.btn-toggle-check.checked {
    background: #A0703B;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-toggle-check.checked svg {
    display: block;
    width: 13px;
    height: 13px;
    stroke: #FFFFFF;
    stroke-width: 2.2;
}

.btn-toggle-check.unchecked {
    background: rgba(43, 38, 32, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
}

.btn-toggle-check.unchecked svg {
    display: none;
}

.card-story-text {
    font-family: var(--font-serif-kr, serif);
    font-size: 13.5px;
    line-height: 1.6;
    color: #4A443E;
    background: #FAF9F7;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: keep-all;
}

.card-action-bar {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 8px;
}

.btn-status {
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-toggle-all {
    background: #F0ECE6;
    color: #554D43;
}

.btn-toggle-all:hover {
    background: #E5E0D8;
}

.btn-approve-submit {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
}

.btn-approve-submit:hover {
    background: var(--accent-brown, #B89065);
}

.btn-approve-submit.mode-reject {
    background: #6E6861;
    color: #FFFFFF;
}

.btn-approve-submit.mode-reject:hover {
    background: #57514B;
}

.btn-revert-mini {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.18);
    color: var(--text-sub, #7A7269);
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-revert-mini:hover {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    border-color: var(--accent-brown, #B89065);
}

/* =========================================
   2. 관리자 업로드 탭
========================================= */
.direct-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.direct-media-card {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.direct-media-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #EAE7E1;
    overflow: hidden;
    position: relative;
}

.direct-media-thumb img,
.direct-media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.direct-media-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.direct-media-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--accent-brown, #B89065);
}

.direct-media-desc {
    font-size: 11.5px;
    color: var(--text-sub, #7A7269);
    line-height: 1.4;
    word-break: keep-all;
    margin: 0;
}

.btn-direct-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(43, 38, 32, 0.7);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-direct-delete:hover {
    background: #D9534F;
}

/* =========================================
   3. 발자취 타임라인 탭
========================================= */
.timeline-form {
    background: #FFFFFF;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.timeline-input-row {
    display: flex;
    gap: 8px;
}

.timeline-input {
    border: 1px solid rgba(43, 38, 32, 0.12);
    background: #FCFAF7;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.timeline-input:focus {
    border-color: var(--accent-brown, #B89065);
}

.timeline-input.date-picker-input {
    width: 155px;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-main, #2B2620);
}

.timeline-input.text-input {
    flex: 1;
}

.btn-timeline-add {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-timeline-add:hover {
    background: var(--accent-brown, #B89065);
}

.admin-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-timeline-item {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-tl-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-tl-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-brown, #B89065);
}

.admin-tl-text {
    font-size: 13.5px;
    color: var(--text-main, #2B2620);
}

.admin-tl-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-tl-edit,
.btn-tl-delete {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 5px;
    font-size: 11.5px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tl-edit {
    color: var(--text-sub, #7A7269);
}

.btn-tl-edit:hover {
    color: var(--accent-brown, #B89065);
    border-color: var(--accent-brown, #B89065);
    background: #FFFDF9;
}

.btn-tl-delete {
    color: #A0988F;
}

.btn-tl-delete:hover {
    color: #D9534F;
    border-color: #D9534F;
    background: #FFF5F5;
}

/* 인라인 수정 폼 */
.edit-mode-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.edit-input-date {
    width: 140px;
    flex-shrink: 0;
    padding: 6px 8px;
    font-size: 12.5px;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    background: #FFFFFF;
    outline: none;
    font-family: inherit;
}

.edit-input-story {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    background: #FFFFFF;
    outline: none;
    font-family: inherit;
}

.edit-action-row {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-edit-save {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    cursor: pointer;
}

.btn-edit-cancel {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #A0988F;
    cursor: pointer;
}

/* =========================================
   4. 무지개 우체통 탭
========================================= */
.postbox-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.postbox-total-text {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
}

.postbox-total-text strong {
    color: var(--accent-brown, #B89065);
}

.postbox-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-postbox-card {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.postbox-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.postbox-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.postbox-author-tag {
    font-size: 11px;
    background: #F4EFEA;
    color: var(--accent-brown, #B89065);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
}

.postbox-author-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
}

.postbox-date {
    font-size: 11.5px;
    color: #A0988F;
}

.btn-postbox-delete {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    color: #A0988F;
    font-size: 11.5px;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-postbox-delete:hover {
    color: #D9534F;
    border-color: #D9534F;
    background: #FFF5F5;
}

.postbox-msg-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main, #2B2620);
    white-space: pre-wrap;
    word-break: keep-all;
    margin: 0;
}

/* =========================================
   공통 공통 요소 (비어있음 / 푸터 / 토스트)
========================================= */
.empty-state {
    text-align: center;
    padding: 50px 0;
    color: var(--text-sub, #7A7269);
    font-size: 13.5px;
}

.admin-footer-links {
    text-align: center;
    margin-top: 40px;
}

.link-btn {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    text-decoration: underline;
}

.toast-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(43, 38, 32, 0.9);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 13.5px;
    letter-spacing: -0.2px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 업로드 드롭존 및 프리뷰 */
.direct-upload-box {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.upload-dropzone {
    border: 1.5px dashed rgba(212, 163, 115, 0.5);
    border-radius: 10px;
    background: #FCFAF7;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover {
    background: #F7F2EA;
    border-color: var(--accent-brown, #B89065);
}

.dropzone-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.dropzone-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
}

.dropzone-sub {
    font-size: 11.5px;
    color: var(--text-sub, #7A7269);
    margin-top: 3px;
}

/* 선택 파일 썸네일 스트립 */
.selected-preview-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 4px;
    margin-top: 8px;
}

.preview-thumb-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(43, 38, 32, 0.12);
}

.preview-thumb-wrap img,
.preview-thumb-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.65);
    color: #FFF;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direct-input-bar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* 전시 카드 내부 인라인 수정 폼 */
.direct-edit-box {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.direct-edit-input {
    flex: 1;
    font-size: 11.5px;
    padding: 4px 6px;
    border: 1px solid var(--accent-brown, #B89065);
    border-radius: 4px;
    outline: none;
    font-family: inherit;
}

.btn-story-action {
    background: transparent;
    border: none;
    color: #A0988F;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    align-self: flex-start;
}

.btn-story-action:hover {
    color: var(--accent-brown, #B89065);
}