/* 1. 기본 배경 및 공통 스타일 (청색 톤 조정) */
body { 
    font-family: 'Malgun Gothic', 'Pretendard', sans-serif; 
    background: #f1f5f9; /* 배경은 눈이 편한 밝은 회청색 */
    margin: 0; 
}

header { 
    background: #1e3a8a; /* 회사 이미지: 짙은 로열 블루 */
    color: white; 
    padding: 15px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 2. 네비게이션 메뉴 스타일 (세련된 청색 탭) */
.nav-tabs { 
    display: flex; 
    background: #2563eb; /* 포인트 블루 */
    padding: 0 20px; 
    gap: 5px; 
}

.nav-tabs button { 
    background: none; 
    border: none; 
    color: #bfdbfe; /* 연한 하늘색 글자 */
    padding: 14px 22px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: bold; 
    transition: 0.3s;
}

.nav-tabs button:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-tabs button.active { 
    background: #f1f5f9; /* 바닥 배경색과 일치시켜 연결감 부여 */
    color: #1e3a8a; 
    border-radius: 10px 10px 0 0; 
}

/* 3. 섹션 관리 */
.tab-content { display: none; padding: 25px; }
.tab-content.active { display: block; }

/* 4. HOME 그리드 & 카트 박스 */
.main-layout { display: flex; gap: 20px; }
.cart-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); 
    gap: 12px; 
    background: white; 
    padding: 25px; 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cart-box { 
    border: 1px solid #e2e8f0; 
    border-radius: 10px; 
    height: 65px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    background: #ffffff; 
    color: #64748b;
    transition: all 0.2s;
}

/* 상태별 색상 (청색 테마에 맞춤) */
.cart-box.active { 
    background: #eff6ff; 
    border-color: #3b82f6; 
    color: #1d4ed8; 
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.cart-box.alert { 
    background: #fff1f2; 
    border-color: #e11d48; 
    color: #be123c; 
    animation: blink 1.5s infinite; 
}

@keyframes blink { 50% { opacity: 0.5; } }

/* 5. 홀별 보기 레이아웃 (청색 강조선) */
/* 홀별 카트 탭 레이아웃 */
#hole-view-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
}

.hole-card {
    background: white;
    width: 120px; /* 카드의 고정 너비 */
    min-height: 100px;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
}

.hole-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.hole-cart-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: flex-start;
}


/* 6. 홀 아이콘 스타일 */
.mini-cart-box { 
    width: 30px; /* 크기를 약간 줄여 3열 구성에서 겹치지 않게 조정 */
    height: 30px;
    background: #f8fafc;
    border: 1px solid #3b82f6;
    color: #1e40af;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: none; /* 입체감 그림자 제거하여 깔끔하게 변경 */
}

.mini-cart-box.active { background-color: #3b82f6; } /* 정상: 파랑 */

.mini-cart-box.alert { 
    background: #fff1f2;
    border-color: #e11d48;
    color: #be123c;
    animation: blink 1.5s infinite;
}

/* 7. 저전압 리스트 테이블 (청색/적색 조화) */
.alert-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.alert-table th { 
    background: #f8fafc; 
    color: #1e3a8a; 
    padding: 15px; 
    text-align: left; 
    border-bottom: 2px solid #e2e8f0;
}

.alert-table td { 
    padding: 14px 15px; 
    border-bottom: 1px solid #f1f5f9; 
    color: #334155;
}

.alert-table tr:hover { background: #f8fafc; }


/* 대시보드 전체 배경 및 폰트 */
.dashboard-wrapper { padding: 10px; background: #f0f2f5; border-radius: 20px; }

/* 그래픽 카드 스타일 */
.top-indicator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 25px; }

.graphic-card {
    background: #1e293b; /* 딥 네이비 */
    border-radius: 18px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.graphic-card:hover { transform: translateY(-5px); }

.course-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.card-icon {
    font-size: 40px;
    background: rgba(255,255,255,0.05);
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
}

/* 맥박 애니메이션 (경고 아이콘) */
.pulse { animation: pulse-red 2s infinite; }
@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); text-shadow: 0 0 10px #ef4444; }
    100% { transform: scale(1); }
}

.card-info .label { color: #94a3b8; font-size: 14px; display: block; }
.value-group { margin: 5px 0; }
.main-value { font-size: 36px; font-weight: 800; }
.unit { font-size: 16px; margin-left: 5px; color: #64748b; }

/* 건강도 게이지 바 */
.health-bar-bg { width: 100%; height: 6px; background: #334155; border-radius: 3px; margin-top: 10px; }
.health-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 3px; }

/* 중앙 분석 박스 */
.main-analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.analysis-box { background: #1e293b; border-radius: 20px; padding: 20px; color: white; }
.box-header { font-size: 16px; font-weight: bold; border-bottom: 1px solid #334155; padding-bottom: 15px; margin-bottom: 20px; }

/* AI 정비 카드 디자인 */
.ai-priority-container { display: flex; flex-direction: column; gap: 12px; }

.priority-card {
    background: rgba(15, 23, 42, 0.6); /* 더 깊이감 있는 배경 */
    border: 1px solid #334155;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.p-id { font-weight: bold; color: #3b82f6; }
.p-level { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.p-level.high { background: #450a0a; color: #f87171; }
.p-level.med { background: #422006; color: #fbbf24; }
.p-msg {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 글자가 길면 ... 처리 */
    max-width: 180px;
}




/* HOME 대시보드 전용 레이아웃 */
.top-indicator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.main-analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }

/* 공통 카드 스타일 (딥 네이비) */
.graphic-card, .analysis-box, .guide-box {
    background: #1e293b; color: white; border-radius: 12px; padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); border: 1px solid #334155;
}

/* 어제 결산 리스트 스타일 */
.report-content { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }

.report-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #1e293b; /* 딥 네이비 */
    border: 1px solid #334155;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.status-dot { width: 16px; height: 16px; border-radius: 50%; }
.status-dot.green { background: #10b981; box-shadow: 0 0 10px #10b981; }
.status-dot.orange { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.status-dot.red { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.status-tag { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #334155; color: #94a3b8; }
.status-tag.warn { color: #fbbf24; background: rgba(245, 158, 11, 0.1); }
.status-tag.danger { color: #f87171; background: rgba(239, 68, 68, 0.1); }

/* AI 정비 권고 카드 */
.priority-card { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #0f172a; margin-bottom: 8px; border-radius: 8px; }
.p-badge { font-size: 10px; font-weight: bold; padding: 3px 6px; border-radius: 4px; }
.p-badge.high { background: #7f1d1d; color: #fecaca; }
.p-badge.med { background: #78350f; color: #fef3c7; }

/* 운행 가이드 박스 */
.guide-box { border-left: 5px solid #3b82f6; background: #0f172a; }
.guide-box h4 { margin-top: 0; color: #60a5fa; }
.guide-box ul { padding-left: 20px; color: #cbd5e1; }
.guide-box li { margin-bottom: 8px; }

/* 숫자가 변할 때 부드러운 전환 효과 */
.value {
    transition: all 0.3s ease;
    display: inline-block;
}


/* SOH 바가 부드럽게 차오르는 애니메이션 */
#soh-bar {
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); /* 가속도 조절 */
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); /* 녹색 광채 */
}

/* 숫자 카운팅 시 살짝 커지는 효과 (생동감 부여) */
.count-up {
    display: inline-block;
    transition: transform 0.2s ease-out;
}

/* 값이 업데이트될 때 아주 잠깐 반짝이는 효과 */
.flash-update {
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); color: #2563eb; }
    100% { opacity: 1; transform: scale(1); }
}


/* 값이 업데이트될 때 반짝이는 효과 (선택 사항) */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #2563eb; }
    100% { transform: scale(1); }
}

.updated {
    animation: highlight 0.5s ease-out;
}

/* SOH 바 애니메이션 */
#soh-bar {
    transition: width 1.5s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}



/* 상태별 신호등 그래픽 아이콘 */
.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
}

/* 불빛이 퍼지는 네온 효과 */
.status-icon.green  { background: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
.status-icon.orange { background: #f59e0b; box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
.status-icon.red    { background: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.6); }

/* 배터리 수치 글자 강조 */
.report-item b {
    font-size: 1.2em;
    color: #f8fafc;
    margin: 0 5px;
}


/* 최상단 모범 카트 전용 스타일 */
.best-sample {
    background: rgba(241, 196, 15, 0.15) !important;
    border: 1px solid rgba(241, 196, 15, 0.4);
    margin-bottom: 15px !important;
}
.best-sample:hover {
    background: rgba(241, 196, 15, 0.25) !important;
}
.best-sample.active {
    background: #f1c40f !important;
    color: #000 !important;
}


/* [수정] 상단 네비게이션 배경색 및 아이콘 색상 설정 */
.top-nav {
    height: 60px;
    background: #1a2236; /* 관제 메인 배경색으로 변경 */
    display: flex; /* Flexbox 사용 */
    align-items: center; /* 수직 중앙 정렬 */
    justify-content: center; /* 수직 중앙 정렬 */
    border-bottom: 1px solid rgba(255,255,255,0.1); /* 남색 배경에 어울리는 얇은 테두리 */
}

/* [수정] 홈 아이콘 색상을 흰색으로 변경 */
.top-nav .home-btn {
    cursor: pointer;
    font-size: 1.5em; /* 아이콘 크기 */
    color: #ffffff; /* 흰색으로 변경 */
    transition: 0.2s; /* 호버 효과 전환 시간 */
}

/* [수정] 호버 시 색상을 약간 밝게 설정 */
.top-nav .home-btn:hover {
    color: #e2e8f0; /* 호버 시 약간 밝은 회색 */
    transform: scale(1.1); /* 호버 시 약간 확대 효과 */
}

:root {
    --primary-blue: #1e3a8a; --bg-light: #f1f5f9; --panel-white: #ffffff;
    --text-dark: #1e293b; --accent-green: #2ecc71; --accent-red: #ef4444;
}

body { margin: 0; font-family: 'Pretendard', sans-serif; background: var(--bg-light); color: var(--text-dark); }

header { background: var(--primary-blue); color: white; padding: 10px 25px; display: flex; justify-content: space-between; align-items: center; }
.subtitle { font-size: 13px; opacity: 0.8; }

.nav-tabs { background: #3b82f6; display: flex; padding: 0 20px; }
.tab-link { background: none; border: none; color: white; padding: 12px 20px; cursor: pointer; font-weight: bold; }
.tab-link.active { background: var(--bg-light); color: var(--primary-blue); border-radius: 8px 8px 0 0; }

.main-layout { display: flex; gap: 20px; padding: 20px; height: calc(100vh - 120px); box-sizing: border-box; }

/* 패널 공통 */
.panel { background: var(--panel-white); border-radius: 12px; padding: 15px; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.panel-title { font-weight: bold; color: var(--primary-blue); margin-bottom: 15px; border-bottom: 1px solid #f1f5f9; padding-bottom: 10px; }

/* 사이드바 */
.left-sidebar { flex: 0 0 300px; }
.right-sidebar { flex: 0 0 300px; display: flex; flex-direction: column; gap: 15px; }

/* 중앙 홀 그리드 */
.center-content { flex: 1; overflow-y: auto; }
.hole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.hole-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; min-height: 100px; }
.hole-card h4 { margin: 0; font-size: 0.9rem; color: #64748b; }

/* AI 닥터 카드 */
.stat-card { background: #f8fafc; padding: 15px; border-radius: 8px; margin-bottom: 10px; text-align: center; }
.big-volt { font-size: 2rem; font-weight: bold; color: var(--accent-green); }
.progress-bar { width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-green); }
.saving-badge { background: #1d4ed8; color: white; padding: 15px; border-radius: 8px; text-align: center; margin: 10px 0; }
.saving-amt { font-size: 1.2rem; font-weight: bold; }

/* 우측 요약박스 */
.stat-box { background: white; padding: 15px; border-radius: 12px; text-align: center; border: 1px solid #e2e8f0; }
.stat-box b { font-size: 2rem; display: block; color: var(--primary-blue); }
.stat-box.alert b { color: var(--accent-red); }
.log-container { height: 300px; overflow-y: auto; font-family: monospace; font-size: 11px; line-height: 1.6; }


