/* css/admin-style.css */
:root {
    --primary-color: #007bff; --primary-dark: #0056b3; --border-color: #dee2e6;
    --white-color: #ffffff; --text-color: #333; --light-bg: #f8f9fa;
    --danger-color: #dc3545; --success-color: #28a745;
}
body { 
    font-family: sans-serif; 
    background-color: var(--light-bg); 
    color: var(--text-color); 
    /* [수정] 로그인 화면을 중앙 정렬하기 위한 기본 스타일 */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    margin: 0;
}

/* [추가] 로그인 성공 시 body 스타일을 되돌려 레이아웃 깨짐 방지 */
body.logged-in {
    display: block;
    align-items: initial;
    justify-content: initial;
}

#login-container { text-align: center; background: var(--white-color); padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
#login-container h2 { margin-bottom: 20px; }
#login-container input { font-size: 1em; padding: 10px; border-radius: 6px; border: 1px solid var(--border-color); margin-bottom: 15px; width: 250px; }
#login-container button { font-size: 1em; padding: 10px 20px; border: none; background: var(--primary-color); color: white; border-radius: 6px; cursor: pointer; }
#login-message { margin-top: 15px; color: var(--danger-color); font-weight: bold; min-height: 1.2em; } /* 메시지 영역 확보 */
.admin-container { padding: 20px; max-width: 900px; margin: 40px auto; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border-radius: 12px; background-color: var(--white-color); }
h1 { color: var(--primary-dark); border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 20px; }
.section { margin-bottom: 30px; }
h2 { font-size: 1.2em; margin-bottom: 15px; color: var(--text-color); }
.telecom-selector { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; flex-wrap: wrap; }
.telecom-selector button { padding: 10px 15px; border: 1px solid var(--border-color); background-color: var(--white-color); border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s ease; }
.telecom-selector button.active { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-weight: 600; margin-bottom: 8px; font-size: 0.9em; }
.form-group input { padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 1em; }
.actions { margin-top: 30px; display: flex; gap: 10px; justify-content: flex-end; }
.actions button, .actions a { padding: 12px 25px; border-radius: 8px; font-size: 1em; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-save { background-color: var(--primary-color); color: var(--white-color); border: none; }
.btn-link { background-color: #6c757d; color: var(--white-color); border: none; display: inline-flex; align-items: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; padding: 15px 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 1000; }
.toast.show { opacity: 1; visibility: visible; } /* [수정] show 클래스에 visibility 추가 */
.toast.show.success { background-color: var(--success-color); }
.toast.show.error { background-color: var(--danger-color); }

/* admin-style.css 파일 맨 아래에 추가 */

.section p.description {
    font-size: 0.9em;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}
/* admin-style.css 파일 맨 아래에 추가 */

/* [추가] 사은품 입력 필드에 '만원' 단위 표시 */
.form-group.gift-group {
    position: relative;
}

.form-group.gift-group::after {
    content: '(만원)';
    position: absolute;
    right: 10px;
    bottom: 11px;
    color: #888;
    font-size: 0.9em;
}
/* admin-style.css 파일 맨 아래에 추가 */

/* [추가] 사은품 정책 그룹 스타일 */
.policy-group {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fdfdfd;
}

.group-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}
/* ... (기존 스타일 유지) ... */

/* [추가] 헤더 및 링크 스타일 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.admin-header h1 {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    white-space: nowrap;
}
.header-actions { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap;
    align-items: center;
}
.btn-link {
    text-decoration: none;
    color: #555;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}
.btn-link:hover { background: #f8f9fa; }
.btn-link.highlight { color: #007bff; border-color: #007bff; font-weight: 700; }

/* [추가] 탭 네비게이션 스타일 */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #f1f3f5;
    color: #666;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn:hover { background: #e9ecef; }
.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

/* 탭 콘텐츠 제어 */
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* [추가] 상담사 관리 테이블 스타일 */
.table-responsive { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.admin-table th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #495057;
}
.profile-thumb {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}
.btn-delete {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.btn-delete:hover { background-color: #c82333; }
.form-group.full-width { grid-column: 1 / -1; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* [추가] 상품 목록 스타일 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.btn-add-item {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-item:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 동적 행 스타일 */
.dynamic-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s;
}

.dynamic-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.dynamic-row.modified {
    border-color: #ffc107;
    background-color: #fffbf0;
}

.dynamic-row.confirmed {
    border-color: var(--success-color);
    background-color: #f0fff4;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 5px;
}

.input-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
}

.dynamic-row input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}

.dynamic-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.btn-row-action {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-confirm-item {
    background-color: #e9ecef;
    color: #6c757d;
}

.btn-confirm-item:hover {
    background-color: #dee2e6;
}

.btn-confirm-item.active {
    background-color: var(--success-color);
    color: white;
    animation: pulse 0.3s;
}

.btn-confirm-item.active:hover {
    background-color: #218838;
}

.btn-remove-item {
    background-color: #f8f9fa;
    color: var(--danger-color);
}

.btn-remove-item:hover {
    background-color: #fee;
    color: #c82333;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 목록 컨테이너 스타일 */
#internet-list-container,
#tv-list-container,
#settop-list-container,
#additionalTv-list-container {
    margin-top: 15px;
}

/* 빈 목록 메시지 */
.empty-list-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* 관리자 설정 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.modal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 30px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal .modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}
.modal .modal-close:hover {
    color: #333;
}
.modal h2 {
    margin-bottom: 20px;
    border-bottom: none;
}
.modal h3 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

/* 깔끔한 버튼 스타일 */
.btn-edit, .btn-delete, .btn-password, .btn-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-edit {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}
.btn-edit:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-delete {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
}
.btn-delete:hover {
    background: #ffe3e3;
    border-color: #ffa8a8;
}

.btn-password {
    background: #e7f5ff;
    color: #1971c2;
    border: 1px solid #a5d8ff;
}
.btn-password:hover {
    background: #d0ebff;
    border-color: #74c0fc;
}

.btn-restore {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-restore:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.btn-cancel {
    background: #f8f9fa;
    color: #868e96;
    border: 1px solid #dee2e6;
}
.btn-cancel:hover {
    background: #e9ecef;
}

.btn-save {
    background: #228be6;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-save:hover {
    background: #1c7ed6;
}

/* 로그아웃 버튼 */
.btn-logout {
    background: #fa5252 !important;
    color: white !important;
    border: none !important;
}
.btn-logout:hover {
    background: #e03131 !important;
}

/* 테이블 내 버튼 간격 */
.admin-table td button {
    margin: 2px;
}

/* 배지 스타일 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge.admin {
    background: #dbeafe;
    color: #1e40af;
}
.badge.staff {
    background: #f3f4f6;
    color: #4b5563;
}

/* 권한 토글 버튼 */
.role-toggle {
    display: flex;
    gap: 8px;
}
.role-btn {
    padding: 8px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.role-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.role-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}
.role-btn.active[data-role="admin"] {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

/* 스탭 테이블 정돈 */
.staff-table {
    table-layout: fixed;
    width: 100%;
}
.staff-table th,
.staff-table td {
    text-align: center;
    vertical-align: middle;
    padding: 12px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.staff-table td:last-child {
    white-space: normal;
}
.staff-table .btn-edit,
.staff-table .btn-delete,
.staff-table .btn-password {
    padding: 5px 10px;
    font-size: 11px;
    margin: 2px;
}