/* --- admin_style.css (관리자 전체 스타일) --- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', Tahoma, sans-serif; 
}

body {
    background-color: #f0f2f5; 
    color: #333;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 메시지 박스 --- */
.alert-message {
    margin: -10px 0 15px 0;
    padding: 15px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid transparent;
    font-size: 14px;
}
.alert-message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.alert-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* --- 1. 로그인 페이지 스타일 (admin_login.php) --- */
.admin-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: #3474B4; 
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #2a6496;
}

.login-note {
    margin-top: 20px;
    font-size: 13px;
    color: #e74c3c;
}

/* --- 2. 관리자 메인 레이아웃 (admin.php) --- */
.admin-sidebar {
    width: 220px;
    background-color: #2c3e50; 
    color: #fff;
    padding-top: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    justify-content: space-between; 
    position: fixed; 
    left: 0;
    top: 0;
    z-index: 10;
}

.sidebar-title {
    font-size: 18px;
    padding: 0 20px 15px;
    border-bottom: 1px solid #4a627a;
    margin-bottom: 10px;
}

.sidebar-nav ul {
    list-style: none;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #f0f2f5;
    transition: background-color 0.2s;
}

.menu-item:hover, .menu-item.active {
    background-color: #34495e;
    color: #fff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #4a627a;
    font-size: 13px;
    margin-top: auto; 
}

.sidebar-footer p {
    font-weight: bold;
    margin-bottom: 5px;
    color: #f0f2f5; 
}

.sidebar-footer .footer-links a {
    display: block;
    color: #f0f2f5;
    text-decoration: none;
    margin-top: 5px;
}
.sidebar-footer .logout-btn {
    color: #e74c3c;
}

.admin-content {
    flex-grow: 1;
    padding: 20px;
    background-color: #fff;
    margin-left: 220px; 
    position: relative;
}

.content-title-modified {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.top-right-logout-btn {
    position: absolute;
    top: 25px; 
    right: 20px;
    color: #3474B4;
    font-weight: bold;
}

.primary-content-tabs-modified {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd; 
}

.tab-modified {
    padding: 8px 12px;
    margin-right: 8px;
    text-decoration: none;
    color: #555;
    background-color: #eee;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid transparent;
    border-bottom: none;
}

.tab-modified.active {
    background-color: #fff;
    color: #3474B4;
    border-color: #ddd;
    border-bottom-color: #fff;
}

.secondary-content-tabs {
    display: flex;
    margin-bottom: 20px;
}

.secondary-content-tabs .sub-tab {
    padding: 8px 12px;
    margin-right: 8px;
    text-decoration: none;
    color: #555;
    background-color: #eee;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid transparent;
    border-bottom: none;
}

.secondary-content-tabs .sub-tab.active {
    background-color: #fff;
    color: #3474B4;
    border-color: #ddd;
    border-bottom-color: #fff;
}

/* 3. 검색 필터 스타일 (공통) - admin.php <style>의 stat-filter-area 내용과 병합 */
.stat-filter-area {
    display: flex;
    gap: 20px; 
    margin-bottom: 20px; /* 통합: 30px -> 20px */
    padding: 15px;
    background-color: #f8f8ff; /* 통합: #f8f8f8 -> #f8f8ff */
    border-radius: 5px; /* 통합: 4px -> 5px */
}

.filter-group { /* admin.php <style>에서 추가 */
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.filter-label { /* admin.php <style>에서 추가/수정 */
    font-weight: bold;
    margin-right: 5px; /* 통합: 10px -> 5px */
}
.date-input, .filter-group select, .filter-group input[type="text"] { /* admin.php <style>에서 추가/수정 */
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 4. 공통 액션 버튼 스타일 */
.btn-action {
    padding: 8px 15px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 3px;
    font-size: 13px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-action:last-child {
    margin-right: 0;
}
.btn-action.primary {
    background-color: #3474B4;
    color: #fff;
    border-color: #3474B4;
}
.btn-action.danger {
    background-color: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
.btn-action.secondary { /* admin.php <style>에만 있던 스타일 추가 */
     background-color: #6c757d;
     color: #fff;
     border-color: #6c757d;
}
.btn-action.btn-sm { 
    padding: 4px 8px; /* 통합: 6px 10px -> 4px 8px */
    font-size: 12px;
}

/* 상단 일괄 관리 버튼 UI */
.top-bulk-actions {
    margin-bottom: 15px; /* 통합: 10px -> 15px */
    display: flex;
    gap: 10px; /* 통합: 5px -> 10px */
    justify-content: flex-end !important; /* flex-end 대신 왼쪽으로 정렬되도록 조정 */
}
.top-delete-btn, .top-save-btn {
    padding: 8px 15px;
    font-size: 14px;
    margin: 0; 
}


/* 5. 테이블 스타일 (공통) */
.data-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left; 
    margin-top: 10px; 
}

.data-list-table th {
    background-color: #3474B4;
    color: #fff;
    font-weight: bold;
    padding: 10px 8px;
    border: 1px solid #3474B4;
    white-space: nowrap; 
	text-align: center;
    vertical-align: middle;
}

.data-list-table td {
    border: 1px solid #ddd;
    padding: 8px;
	text-align: center;
    vertical-align: middle;
}

.data-list-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-list-table input[type="checkbox"] {
    margin-right: 5px;
}

/* 데이터 없음 메시지 */
.no-data-message {
    text-align: center;
    padding: 20px;
    color: #777;
    font-style: italic;
}

/* 6. 통계 테이블 스타일 (stat-table) - admin.php <style>에서 통합 */
.stat-table {
    border-collapse: collapse; 
    border: 1px solid #ccc; 
}
.stat-table th, .stat-table td {
    border: 1px solid #ccc;
    vertical-align: middle;
    text-align: center;
}
.stat-table th {
    background-color: #3f6e9c; /* 통합: #3474B4 -> #3f6e9c */
    color: white; 
}
.stat-table td {
    text-align: right;
}
.stat-table td:first-child, .stat-table tfoot td:first-child {
    text-align: center;
}
.stat-table .red-text {
    color: red !important;
}
.stat-table .white-text { 
    color: white !important;
}

/* 7. 상품 관리 테이블 스타일 (product-table) */
.product-table img { /* admin.php <style>에서 추가 */
    width: 50px;
    height: 50px;
    object-fit: contain; 
    border: 1px solid #eee;
    vertical-align: middle;
}
.product-table th, .product-table td { /* admin.php <style>에서 통합/수정 */
    padding: 8px 5px;
    font-size: 13px;
}

/* 공통 form-control 스타일 */
.form-control { 
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}
.form-control-sm { /* admin.php <style>에서 추가 */
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 12px;
}

/* 상품 목록 테이블 내 input/select 너비 조정 */
.product-table input[type="text"] {
    width: 100%;
}
.product-table .price-input {
    width: 80px; 
}
.product-table .stock-input {
    width: 60px; 
}

/* 상품 등록 폼 */
.product-add-area {
    max-width: 500px; 
    margin-top: 20px;
}
.product-add-area .form-group-admin {
    margin-bottom: 15px;
}
.product-add-area .form-group-admin label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.product-control-footer { 
    margin-top: 20px;
    text-align: right;
}

/* 8. 주문 관리 테이블 스타일 (order-table) - admin.php <style>에서 통합/수정 */
.order-table th, .order-table td {
    vertical-align: top;
    padding: 5px;
    min-width: 50px;
}
.order-table thead th {
    font-size: 14px; 
    font-weight: bold;
}
.order-table tbody td {
    font-size: 13px;
}
.order-table tbody td:nth-child(4) ul {
    font-size: 11px !important;
}
.order-table tbody td:nth-child(5) { /* 총 수량 강조 */
    background-color: #f7f7f7;
}
.order-table input[type="text"], .order-table select {
    width: 98%;
    min-width: 50px;
}
.order-table .full-width-input {
    width: 98%;
}
.order-table .tracking-input-area {
    margin-top: 5px;
}
.order-table .tracking-input-area input {
    width: 95%;
    margin-top: 3px;
}

/* 주문 검색 폼 스타일 */
.order-search-form .search-container { /* admin.php <style>에서 통합/수정 */
    display: flex;
    gap: 0; 
    margin-bottom: 20px;
    width: 450px; 
    max-width: 100%;
    margin-left: 0; 
    margin-right: auto;
    margin-top: 20px;
}
.order-search-form .search-container select {
    width: 90px;
    border-radius: 4px 0 0 4px !important;
    border-right: 1px solid #ccc; 
    padding: 6px;
    font-size: 13px;
    height: 38px; 
}
.order-search-form .search-container input[type="text"] {
    flex-grow: 1;	
    border-radius: 0 !important;
    min-width: 200px; 
    max-width: 300px; 
    margin-left: -1px; 
    border-left: 1px solid #ccc;
    padding: 6px 10px;
    font-size: 13px;
    height: 38px; 
}
.order-search-form .search-container button {
    width: 70px !important;
    border-radius: 0 4px 4px 0 !important;
    margin-left: -1px !important;
    height: 38px; 
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1;
}
.order-search-form .search-container .btn-reset {
    width: 70px !important;
    margin-left: 10px !important;
    background-color: #6c757d !important;
    border: 1px solid #6c757d !important;
    color: white !important;
    border-radius: 4px !important;
    height: 38px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; 
}

/* 송장번호 표시 스타일 */
.tracking-info { /* admin.php <style>에서 추가 */
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.tracking-link {
    display: block;
    color: #3498db;
    text-align: center;
    text-decoration: underline;
}
.delivery-status {
    font-weight: bold;
    color: #e74c3c;
}

/* 9. 모달 관련 스타일 (order-detail-modal) - admin.php <style>에서 통합 */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.order-detail-modal {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}
.modal-close-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.2em;
    cursor: pointer;
    color: #333;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: all 0.2s;
}
.modal-close-btn:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}
.product-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.product-detail-table th, .product-detail-table td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 13px;
}
.product-detail-table th {
    background-color: #3f6e9c; 
    color: white;
    text-align: center;
}
.product-detail-table tbody tr:nth-child(odd) {
    background-color: #fffff;
}
.product-detail-table td {
    text-align: left;
}
.product-detail-table td:nth-child(3), /* 개별수량 */
.product-detail-table td:nth-child(4), /* 개별금액 */
.product-detail-table td:nth-child(5) { /* 소계 */
    text-align: right;
}
.product-detail-table tfoot td {
    font-weight: bold;
    background-color: #fffff; 
    border-top: 2px solid #3f6e9c;
}
.product-detail-table tfoot td:first-child {
    text-align: center !important;
}
.product-detail-table .product-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 10px;
    border: 1px solid #eee;
}
/* 답변 입력 영역 */
.qna-answer-area textarea { 
    /* ... (기타 스타일 유지) ... */
    margin-bottom: 5px; /* 버튼 그룹과의 간격 확보 */
}

.answer-btn-group { 
    /* 버튼 그룹을 오른쪽으로 정렬합니다. */
    text-align: right; 
    margin-top: 5px; 
    /* 버튼들을 같은 줄에 오른쪽 끝에 붙이도록 플렉스박스 적용 */
    display: flex;
    justify-content: flex-end; /* 오른쪽 끝으로 정렬 */
    gap: 5px; /* 버튼 사이 간격 */
}