/* ==== 기본 레이아웃 ==== */
html, body { height: 100%; }
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background-color: #f5f7fa;
}

#wrapper {
    min-height: 100vh;
}

/* ==== 사이드바 ==== */
.sidebar {
    width: 240px;
    min-width: 240px;
    transition: margin-left 0.25s ease-in-out;
    min-height: 100vh;
}

.sidebar .sidebar-header h5 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 흰 배경 사이드바용 링크 스타일 */
.sidebar .sidebar-link {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 0.92rem;
    color: #0a3d6b;              /* 로고 톤에 맞는 진한 파랑 */
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none;
}
.sidebar .sidebar-link:hover {
    background-color: #eaf3fb;
    color: #0a3d6b;
}
.sidebar .sidebar-link.active {
    background-color: #0a3d6b;
    color: #fff;
}
.sidebar .sidebar-link i {
    width: 20px;
    margin-right: 6px;
}

#wrapper.toggled .sidebar {
    margin-left: -240px;
}

@media (max-width: 768px) {
    .sidebar { margin-left: -240px; }
    #wrapper.toggled .sidebar { margin-left: 0; }
}

/* ==== 본문 ==== */
#page-content-wrapper {
    min-width: 0;
    width: 100%;
}

.navbar {
    height: 56px;
}

main {
    min-height: calc(100vh - 56px);
}

/* ==== KPI 카드 ==== */
.kpi-card {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08) !important;
}
.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.kpi-card.kpi-danger { border-left: 4px solid #dc3545 !important; }
.kpi-card.kpi-warning { border-left: 4px solid #ffc107 !important; }
.kpi-card.kpi-info { border-left: 4px solid #0d6efd !important; }

/* ==== 통합 검색 ==== */
.global-search input {
    border-left: 0;
}
.global-search .input-group-text {
    border-right: 0;
}
#globalSearchResults .list-group-item {
    cursor: pointer;
    padding: 0.6rem 0.9rem;
}
#globalSearchResults .list-group-item:hover {
    background-color: #eef3ff;
}
#globalSearchResults .badge {
    font-size: 0.7rem;
}

/* ==== 카드/테이블 보조 ==== */
.card {
    border-radius: 10px;
}
.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-size: 0.92rem;
}
.table thead th {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}
.table tbody td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ==== 뱃지 ==== */
.badge {
    font-weight: 500;
    letter-spacing: 0;
}

/* ==== 로그인 페이지 ==== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* ==== Toast ==== */
.toast-container .toast {
    min-width: 280px;
}

/* ==== 뷰티 뱃지 ==== */
.bg-beauty {
    background-color: #8B7355 !important;
    color: #fff !important;
}

/* ==== 뷰티클리닉 테마 (따뜻한 브라운톤) ==== */
[data-clinic="beauty"] .sidebar .sidebar-link {
    color: #6B5B4E;
}
[data-clinic="beauty"] .sidebar .sidebar-link:hover {
    background-color: #F3EDE7;
    color: #5C4A3A;
}
[data-clinic="beauty"] .sidebar .sidebar-link.active {
    background-color: #8B7355;
    color: #fff;
}
[data-clinic="beauty"] .login-wrapper {
    background: linear-gradient(135deg, #C4A882, #8B7355);
}
[data-clinic="beauty"] .navbar {
    background-color: #FAF6F1 !important;
    border-bottom-color: #E8DDD0 !important;
}
[data-clinic="beauty"] .card-header {
    background-color: #F5EDE3 !important;
    color: #5C4A3A !important;
}
[data-clinic="beauty"] .kpi-card.kpi-info {
    border-left-color: #8B7355 !important;
}
[data-clinic="beauty"] body {
    background-color: #FAF7F4;
}
[data-clinic="beauty"] #clinicSelect {
    border-color: #C4A882;
    color: #5C4A3A;
}
