/* TM센터 고객정보 관리 시스템 - 스타일 */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --bg-main: #f0f2f5;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

* {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 네비게이션 */
.navbar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
}

.navbar-brand {
    font-size: 1.1rem;
    letter-spacing: -0.3px;
}

.msg-badge {
    position: absolute;
    top: 2px;
    right: -6px;
    font-size: 0.65rem;
    animation: pulse 2s infinite;
}

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

/* 카드 스타일 */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
}

/* 대시보드 통계 카드 */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.15;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.85rem;
}

.bg-gradient-blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bg-gradient-green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.bg-gradient-orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.bg-gradient-purple { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

/* 테이블 */
.table {
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    white-space: nowrap;
}

.table tbody tr {
    transition: background 0.15s;
}

.table tbody tr:hover {
    background-color: #e8f4fd;
}

/* 상태 뱃지 */
.badge-status {
    padding: 0.4em 0.8em;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.78rem;
}

/* 폼 스타일 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0.6rem 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.88rem;
    color: #495057;
    margin-bottom: 0.3rem;
}

/* 버튼 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.15s;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca, #084298);
    transform: translateY(-1px);
}

/* 로그인 페이지 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    padding: 2rem;
    text-align: center;
    color: white;
}

.login-header h2 {
    font-weight: 700;
    margin: 0.5rem 0 0;
}

.login-body {
    padding: 2rem;
    background: white;
}

/* 메신저 */
.messenger-container {
    height: calc(100vh - 200px);
    display: flex;
    gap: 1rem;
}

.user-list {
    width: 280px;
    min-width: 280px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow-y: auto;
}

.user-list-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: inherit;
}

.user-list-item:hover, .user-list-item.active {
    background: #e8f4fd;
}

.user-list-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-list-item .unread-dot {
    width: 10px;
    height: 10px;
    background: #dc3545;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

.chat-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message-bubble {
    max-width: 70%;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
}

/* 토스트 알림 */
.toast-message {
    border-left: 4px solid #0d6efd;
}

/* 반응형 */
@media (max-width: 768px) {
    .messenger-container {
        flex-direction: column;
        height: auto;
    }
    .user-list {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
    }
    .chat-area {
        min-height: 400px;
    }
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

/* 섹션 헤더 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h4 {
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* 검색 영역 */
.search-area {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

/* 필수항목 표시 */
.required::after {
    content: ' *';
    color: #dc3545;
}

/* 비밀번호 변경 모달 등 */
.modal-header {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* 페이지네이션 */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: #495057;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
}

/* empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}
