/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 헤더 스타일 */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 60px;
    width: auto;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.member-console-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
}

.member-console-link:hover {
    text-decoration: underline;
}

.admin-name {
    font-weight: 600;
}

.logout-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #e0e0e0;
}

/* 컨테이너 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

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

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #e8f0fe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 24px;
}

.stat-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-change {
    font-size: 14px;
    margin-top: 5px;
    color: #666;
}

.stat-change.positive {
    color: #34a853;
}

.stat-change.negative {
    color: #ea4335;
}

/* 필터 섹션 */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filter-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.filter-btn {
    padding: 10px 24px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.filter-btn:hover {
    background: #1557c0;
}

.export-btn {
    padding: 10px 24px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.export-btn:hover {
    background: #2d8e47;
}

/* 회원 테이블 */
.member-table-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.member-table-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.table-responsive {
    overflow-x: auto;
}

.member-table {
    width: 100%;
    border-collapse: collapse;
}

.member-table th,
.member-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.member-table th {
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.member-table tr:hover {
    background: #f8f9fa;
}

/* 상태 드롭다운 */
.status-dropdown {
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.status-dropdown.active {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.status-dropdown.inactive {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.status-dropdown.suspended {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.status-dropdown.withdrawn {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 상세 버튼 */
.detail-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

.detail-btn:hover {
    background: #1557b0;
}

/* 등급 배지 */
.level-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.level-1단계 { background: #fff3cd; color: #856404; }
.level-2단계 { background: #d4edda; color: #155724; }
.level-3단계 { background: #d1ecf1; color: #0c5460; }
.level-4단계 { background: #cce5ff; color: #004085; }
.level-5단계 { background: #e2d5f1; color: #563d7c; }
.level-6단계 { background: #f8d7da; color: #721c24; }
.level-7단계 { background: #d6f5d6; color: #155724; }
.level-8단계 { background: #b8daff; color: #004085; }
.level-9단계 { background: #d5c4e9; color: #432874; }
.level-10단계 { background: #ffd700; color: #ff8c00; font-weight: bold; }

/* 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.items-per-page-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.items-per-page-control select {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.pagination button:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 30px auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #1a73e8 0%, #1557c0 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: normal;
    background: rgba(255,255,255,0.2);
}

.close-btn {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: transform 0.3s;
}

.close-btn:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

/* 탭 스타일 */
.detail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.detail-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -12px;
}

.detail-tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.detail-tab:hover {
    color: #1a73e8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 상세 섹션 */
.detail-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.detail-section h3 {
    font-size: 18px;
    color: #1a73e8;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.detail-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.detail-value {
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

/* 추천 회원 리스트 */
.referral-list {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.referral-list h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.referral-table {
    width: 100%;
    border-collapse: collapse;
}

.referral-table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.referral-table td {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.referral-table tr:hover {
    background: #f8f9fa;
}

/* 메모 섹션 */
.memo-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.memo-section h3 {
    font-size: 18px;
    color: #1a73e8;
    margin-bottom: 20px;
}

.memo-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

.save-memo-btn {
    background: #34a853;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.save-memo-btn:hover {
    background: #2d8e47;
}

.memo-history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.memo-history h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.memo-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.memo-item p {
    margin: 0 0 5px 0;
    color: #333;
}

.memo-item small {
    color: #666;
    font-size: 12px;
}

/* 파일 그리드 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.file-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.file-name {
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.file-type {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* 납입 체크리스트 */
.payment-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.payment-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-item.paid {
    background: #d4edda;
    border-color: #28a745;
}

.payment-item.pending {
    background: #fff3cd;
    border-color: #ffc107;
}

.payment-checkbox {
    width: 20px;
    height: 20px;
}

/* 로딩 스피너 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #1a73e8;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-tabs {
        flex-wrap: wrap;
    }
    
    .detail-tab {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
}