:root {
    --primary: #001A8E;
    --bg: #f4f7f9;
    --border: #e0e6ed;
}

body.admin-body {
    margin: 0;
    font-family: 'Pretendard', sans-serif;
    background: var(--bg);
}

/* Auth Layout */
/* --- 리니어 미니멀리즘 디자인 --- */
.auth-container.linear-design {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    overflow: hidden;
    position: relative;
    font-family: 'Pretendard', sans-serif;
}

.linear-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 450px;
}

/* 수직 정렬 가이드선 */
.brand-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.admin-top-logo {
    height: 35px;
    margin-bottom: 20px;
}

.vertical-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #001A8E, transparent);
}

/* 제목 레이아웃 */
.main-title {
    font-size: 28px;
    font-weight: 800;
    color: #111;
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.main-title .thin {
    font-weight: 200;
    color: #999;
}

.sub-title {
    font-size: 11px;
    color: #bbb;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 60px;
}

/* 입력 필드 스택 */
.input-stack {
    margin-bottom: 50px;
}

.field-row {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
}

.field-label {
    font-size: 10px;
    font-weight: 800;
    color: #001A8E;
    width: 40px;
    text-align: left;
    opacity: 0.5;
}

.field-row input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 15px;
    font-size: 15px;
    color: #333;
    letter-spacing: 1px;
}

.field-row input::placeholder {
    color: #ddd;
    font-weight: 300;
}

.field-row input:focus {
    outline: none;
}

/* 아래쪽 가로선 애니메이션 */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #f0f0f0;
    transition: 0.4s ease;
}

.field-row input:focus~.bottom-bar {
    background: #001A8E;
    height: 2px;
}

/* 액세스 버튼 */
.btn-linear-gate {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    width: 100%;
    padding: 20px;
    transition: 0.3s;
    position: relative;
    z-index: 20;
}

.btn-linear-gate .text {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    letter-spacing: 3px;
}

.arrow-svg {
    width: 18px;
    fill: #001A8E;
    transition: 0.3s;
}

.btn-linear-gate:hover .arrow-svg {
    transform: translateX(10px);
}

.btn-linear-gate:hover .text {
    color: #001A8E;
}

/* 시스템 하단 메타 정보 */
.system-meta {
    position: absolute;
    bottom: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.meta-item {
    font-size: 10px;
    color: #ccc;
    letter-spacing: 1.5px;
}

.meta-divider {
    width: 1px;
    height: 10px;
    background: #eee;
}

/* Sidebar & Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100%;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-logo {
    height: 22px;
}

.nav-item {
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
}

.nav-item.active {
    background: #f0f3ff;
    color: var(--primary);
    border-right: 4px solid var(--primary);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: white;
    height: 70px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.content-body {
    padding: 40px;
    flex: 1;
}

/* Cards & Tables */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.form-grid {
    display: grid;
    grid-template-columns: 120px 1fr 250px 100px;
    gap: 10px;
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
}

.interactive tbody tr:hover {
    background: #f9f9ff;
    cursor: pointer;
}

/* Footer Bot */
.admin-footer-bot {
    background: #fff;
    padding: 25px 40px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.footer-util-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fd-list--util {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 20px;
}

.fd-link {
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

.copyright {
    font-size: 13px;
    color: #999;
}

/* Modal & Wide Design (디자인 업그레이드) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 20, 0.6);
    /* 배경을 살짝 푸른빛이 도는 다크톤으로 변경 */
    backdrop-filter: blur(5px);
    /* 배경 블러 처리 (최신 트렌드) */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content.wide-modal {
    width: 90%;
    max-width: 950px;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    background: #f8fafc;
    /* 모달 전체 배경색 */
}

/* 헤더 영역 */
.gradient-header {
    background: linear-gradient(135deg, #001A8E 0%, #000b42 100%);
    padding: 24px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title i {
    font-size: 22px;
    color: #8bb4ff;
}

.header-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #ff4d4f;
    transform: rotate(90deg);
    /* 호버 시 회전 액션 */
}

/* 본문 레이아웃 */
.modern-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    padding: 35px;
    gap: 30px;
}

/* 왼쪽 정보 패널 (카드 스타일) */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #eef1f6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 26, 142, 0.06);
}

.info-item label {
    display: block;
    font-size: 11px;
    color: #001A8E;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.8;
}

.highlight-name {
    font-size: 18px !important;
    font-weight: 800;
    color: #111 !important;
    margin: 0 0 6px 0 !important;
}

.info-item p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* 첨부파일 태그 디자인 */
.file-list-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f0f4f8;
    border: 1px solid #dce4ec;
    border-radius: 10px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    word-break: break-all;
}

.file-tag i {
    color: #001A8E;
}

.file-tag:hover {
    background: #001A8E;
    color: white;
    border-color: #001A8E;
}

.file-tag:hover i {
    color: white;
}

/* 오른쪽 본문 내용 (메시지 박스) */
.content-panel {
    display: flex;
    flex-direction: column;
}

.content-panel>label {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-message-box {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #eef1f6;
    border-radius: 16px;
    min-height: 350px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    /* 안쪽 그림자로 음각 느낌 부여 */
    white-space: pre-wrap;
    flex: 1;
    position: relative;
    overflow-y: auto;
}

/* 내용 박스 상단에 디자인 포인트 추가 */
.modern-message-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    width: 40px;
    height: 4px;
    background: #001A8E;
    border-radius: 0 0 4px 4px;
}

/* 스크롤바 디자인 (메시지가 길어질 경우) */
.modern-message-box::-webkit-scrollbar {
    width: 6px;
}

.modern-message-box::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.modern-message-box::-webkit-scrollbar-track {
    background: transparent;
}

/* UI Elements */
.file-custom {
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 12px;
}

.file-custom label {
    background: #eee;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 10px;
}

.file-custom input {
    display: none;
}

.btn-del {
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ffcccc;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-del:hover {
    background: #ff4d4f;
    color: #fff;
}

.star-icon {
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.star-icon.active {
    color: #ffcc00 !important;
    animation: pulseStar 0.4s ease-out;
}

@keyframes pulseStar {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.animate-table tbody tr {
    opacity: 0;
    transform: translateY(15px);
}

/* =========================================================
   [ADMIN] 모바일 반응형 완벽 대응
   ========================================================= */
@media (max-width: 980px) {

    /* 1. 로그인 화면 여백 확보 */
    .linear-wrapper {
        padding: 0 30px;
        box-sizing: border-box;
    }

    /* 2. 레이아웃: 사이드바를 위쪽 네비게이션으로 변경 */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        /* 고정 해제 */
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 100;
    }

    .sidebar-header {
        padding: 15px 20px;
    }

    .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        /* 탭 형태로 가로 스크롤 허용 */
        white-space: nowrap;
        padding: 0 10px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-item {
        padding: 12px 20px;
        border-right: none;
        border-bottom: 3px solid transparent;
        font-size: 14px;
    }

    .nav-item.active {
        border-right: none;
        border-bottom: 3px solid var(--primary);
        background: transparent;
    }

    .nav-divider {
        display: none;
        /* 가로 모드에선 구분선 숨김 */
    }

    .main-content {
        margin-left: 0;
        /* 사이드바 공간 확보 해제 */
        width: 100%;
    }

    /* 3. 본문 및 폼 그리드 모바일 정렬 */
    .content-header {
        padding: 0 20px;
        height: 60px;
    }

    .content-body {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        /* 입력 폼을 1단 세로형으로 변경 */
        gap: 15px;
    }

    .file-custom {
        justify-content: space-between;
    }

    .form-grid button[type="submit"] {
        width: 100%;
        padding: 12px;
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 6px;
        font-weight: bold;
    }

    /* 4. 관리자 테이블 가로 스크롤 (화면 짤림 방지) */
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        /* 표가 길면 좌우 스크롤 생성 */
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 700px;
        /* 강제로 최소 너비를 주어 내용이 뭉개지지 않게 함 */
    }

    /* 5. 모달 (고객 문의 상세 내용) 모바일 최적화 */
    .modal-content.wide-modal {
        width: 95%;
        max-height: 90vh;
        /* 화면 밖으로 나가지 않게 제한 */
        overflow-y: auto;
        /* 모달 내부 스크롤 허용 */
        border-radius: 16px;
    }

    .gradient-header {
        padding: 20px;
    }

    .header-title h2 {
        font-size: 16px;
    }

    .modern-grid {
        grid-template-columns: 1fr;
        /* 왼쪽 정보창과 오른쪽 내용창을 세로로 배치 */
        padding: 20px;
        gap: 20px;
    }

    .modern-message-box {
        min-height: 200px;
        /* 내용 박스 최소 높이 축소 */
        padding: 20px;
    }

    /* 6. 푸터 모바일 정렬 */
    .admin-footer-bot {
        padding: 20px;
    }

    .footer-util-wrap {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .fd-list--util {
        flex-wrap: wrap;
        justify-content: center;
    }
}