/* 사용자 관리 - 깔끔한 스타일 */
.user-management-container {
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

/* 헤더 */
.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 25px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 24px;
}

.header-subtitle {
    color: #586069;
    font-size: 14px;
}

/* 통계 카드 - 심플한 디자인 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #0366d6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 각 카드별 아이콘 색상만 다르게 */
.stat-card.total .stat-icon {
    color: #586069;
    background: #f6f8fa;
    padding: 10px;
    border-radius: 8px;
}

.stat-card.active .stat-icon {
    color: #28a745;
    background: #f0fff4;
    padding: 10px;
    border-radius: 8px;
}

.stat-card.members .stat-icon {
    color: #0366d6;
    background: #f1f8ff;
    padding: 10px;
    border-radius: 8px;
}

.stat-card.trial .stat-icon {
    color: #fb8500;
    background: #fff8f0;
    padding: 10px;
    border-radius: 8px;
}

.stat-card.admin .stat-icon {
    color: #6f42c1;
    background: #f8f5ff;
    padding: 10px;
    border-radius: 8px;
}

.stat-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #24292e;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #586069;
    margin-top: 2px;
}

/* 필터 섹션 - 심플 */
.filter-container {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* 검색 박스 */
.search-wrapper {
    margin-bottom: 15px;
}

.search-box {
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.filter-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: #586069;
    font-weight: 500;
    min-width: 40px;
}

.filter-buttons {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #586069;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.filter-btn.active {
    background: #0366d6;
    color: white;
    border-color: #0366d6;
}

/* 일괄 작업 */
.bulk-actions {
    background: #fffbf0;
    border: 1px solid #fdb833;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-count {
    font-weight: 600;
    color: #735c0f;
    font-size: 14px;
}

.bulk-buttons {
    display: flex;
    gap: 8px;
}

/* 테이블 - 깔끔한 스타일 */
.table-container {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: #f6f8fa;
    border-bottom: 1px solid #e1e4e8;
}

.users-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #24292e;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table tbody tr {
    border-bottom: 1px solid #e1e4e8;
    transition: background 0.1s;
}

.users-table tbody tr:hover {
    background: #f6f8fa;
}

.users-table tbody tr.selected {
    background: #f1f8ff;
}

.users-table tbody tr.selected td {
    color: #24292e !important; /* 선택된 행의 텍스트 색상 명시적 설정 */
}

.users-table tbody tr:last-child {
    border-bottom: none;
}

.users-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #24292e;
}

/* 체크박스 */
.checkbox-col {
    width: 40px;
}

.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 사용자 정보 셀 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #586069;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: #24292e;
    font-size: 14px;
}

.user-id {
    font-size: 12px;
    color: #586069;
}

/* 계정 타입 배지 - 심플 */
.account-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.account-type-badge.type-members {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.account-type-badge.type-trial {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* 권한 배지 - 심플 */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.role-admin {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.role-badge.role-user {
    background: #f0f0f0;
    color: #525252;
    border: 1px solid #e5e5e5;
}

/* 상태 배지 - 심플 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* 작업 버튼 - 심플 */
.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border: 1px solid #e1e4e8;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.btn-icon.btn-edit:hover {
    border-color: #0366d6;
    color: #0366d6;
}

.btn-icon.btn-password:hover {
    border-color: #fb8500;
    color: #fb8500;
}

.btn-icon.btn-delete:hover {
    border-color: #d73a49;
    color: #d73a49;
}

/* 페이지네이션 - 심플 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
}

.page-info {
    font-size: 14px;
    color: #586069;
}

.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e1e4e8;
    background: white;
    color: #24292e;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-btn:hover:not([disabled]) {
    background: #f6f8fa;
}

.page-btn.active {
    background: #0366d6;
    color: white;
    border-color: #0366d6;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 8px;
    color: #586069;
}

/* 버튼 스타일 - 심플 */
.btn {
    padding: 8px 16px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
}

.btn-primary {
    background: #0366d6;
    color: white;
    border-color: #0366d6;
}

.btn-primary:hover {
    background: #0256c7;
    border-color: #0256c7;
}

.btn-secondary {
    background: white;
    color: #24292e;
    border-color: #e1e4e8;
}

.btn-secondary:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.btn-warning {
    background: white;
    color: #24292e;  /* 검은색으로 변경 */
    border-color: #fdb833;
}

.btn-warning:hover {
    background: #fffbf0;
    color: #24292e;  /* hover 시에도 검은색 유지 */
}

.btn-danger {
    background: white;
    color: #24292e;  /* 검은색으로 변경 */
    border-color: #d73a49;
}

.btn-danger:hover {
    background: #ffeef0;
    color: #24292e;  /* hover 시에도 검은색 유지 */
}

.btn-info {
    background: white;
    color: #0366d6;
    border-color: #0366d6;
}

.btn-info:hover {
    background: #f1f8ff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 40px !important;
    color: #586069;
}

.spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 3px solid #e1e4e8;
    border-top: 3px solid #0366d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 모달 개선 */
.modal-content {
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    background: white;
    max-height: calc(100vh - 40px) !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
    background: #f6f8fa;
    flex-shrink: 0 !important;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #24292e;
}

.modal-body {
    padding: 20px;
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e1e4e8;
    background: #f6f8fa;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0 !important;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #24292e;
    margin-bottom: 6px;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.form-text {
    font-size: 12px;
    color: #586069;
    margin-top: 4px;
}

/* textarea 스타일 */
.form-control[type="textarea"],
textarea.form-control {
    min-height: 80px;
    max-height: 120px;
    resize: vertical;
}

/* 모달 내 폼 스타일 */
#userForm {
    display: flex;
    flex-direction: column;
    gap: 0; /* form-row에서 간격 관리 */
}

/* 반응형 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .users-table {
        min-width: 700px;
    }
    
    .modal-content {
        width: calc(100% - 20px) !important;
        max-height: calc(100vh - 20px) !important;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* 낮은 해상도 화면 대응 */
@media (max-height: 800px) {
    .modal-body {
        max-height: 450px !important;
    }
}

@media (max-height: 700px) {
    .modal-body {
        max-height: 350px !important;
    }
}

@media (max-height: 600px) {
    .modal-body {
        max-height: 280px !important;
    }
    
    .form-control[type="textarea"],
    textarea.form-control {
        min-height: 60px;
        max-height: 80px;
    }
}

@media (max-height: 500px) {
    .modal-body {
        max-height: 200px !important;
    }
}

/* 호버 효과 제거 원하면 */
* {
    transition: none !important;
}

.stat-card:hover,
.filter-btn:hover,
.btn-icon:hover,
.page-btn:hover:not([disabled]),
.btn:hover,
.users-table tbody tr:hover {
    transition: all 0.2s !important;
}