/* ════════════════════════════════════════════════════════════
   GlobalCRM — 10가지 개인 테마 (색상 + 구조 변경)
   ════════════════════════════════════════════════════════════ */

/* ══ 공통 전환 효과 ══════════════════════════════════════════ */
.sidebar, .main-content, .card, body {
    transition: background .3s, margin .3s, width .3s, color .3s;
}

/* ══════════════════════════════════════════════════════════
   01. DEFAULT — 현재 다크 블루 (변경 없음)
   ══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   02. DARK GLASS — 더 깊은 다크 + 반투명 카드
   구조: 동일 (사이드바 좌측) / 카드 유리 효과
   ══════════════════════════════════════════════════════════ */
body.theme-dark-glass { background: #020617 !important; }
body.theme-dark-glass .sidebar { background: #020617 !important; border-right: 1px solid rgba(56,189,248,.15) !important; }
body.theme-dark-glass .main-content { background: #020617 !important; }
body.theme-dark-glass .sidebar .menu-link.active,
body.theme-dark-glass .sidebar .menu-link:hover { background: rgba(56,189,248,.12) !important; color: #38bdf8 !important; }
body.theme-dark-glass .sidebar .menu-icon { background: rgba(56,189,248,.15) !important; color: #38bdf8 !important; }
body.theme-dark-glass .card {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(56,189,248,.15) !important;
    backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════════════════════
   03. NEO BRUTALISM — 라이트 + 굵은 테두리 + 옐로우
   구조: 사이드바 좌측 (블랙) / 콘텐츠 라이트 / 카드 오프셋 그림자
   ══════════════════════════════════════════════════════════ */
body.theme-neo-brutal { background: #fffbf0 !important; color: #18181b !important; }
body.theme-neo-brutal .sidebar { background: #18181b !important; border-right: 3px solid #fbbf24 !important; }
body.theme-neo-brutal .sidebar .menu-link { color: #fafafa !important; border-radius: 0 !important; }
body.theme-neo-brutal .sidebar .menu-link.active,
body.theme-neo-brutal .sidebar .menu-link:hover { background: #fbbf24 !important; color: #18181b !important; border-radius: 0 !important; }
body.theme-neo-brutal .sidebar .menu-icon { background: transparent !important; color: inherit !important; }
body.theme-neo-brutal .main-content { background: #fffbf0 !important; color: #18181b !important; }
body.theme-neo-brutal .card {
    background: #fff !important;
    border: 2px solid #18181b !important;
    border-radius: 0 !important;
    box-shadow: 5px 5px 0 #18181b !important;
    color: #18181b !important;
}
body.theme-neo-brutal .card * { color: #18181b !important; }
body.theme-neo-brutal .btn-primary {
    background: #18181b !important; border: 2px solid #18181b !important;
    border-radius: 0 !important; color: #fbbf24 !important;
    box-shadow: 3px 3px 0 #fbbf24 !important;
}
body.theme-neo-brutal h1, body.theme-neo-brutal h2,
body.theme-neo-brutal h3, body.theme-neo-brutal h4,
body.theme-neo-brutal h5, body.theme-neo-brutal .page-title { color: #18181b !important; }

/* ══════════════════════════════════════════════════════════
   04. ULTRA MINIMAL — 사이드바 숨기고 상단 탑바로 전환
   구조: 상단 가로 탑바 / 콘텐츠 풀와이드 / 여백 극대화
   ══════════════════════════════════════════════════════════ */
body.theme-minimal .sidebar {
    width: 100% !important;
    height: 52px !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    flex-direction: row !important;
    overflow: hidden !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
    background: #ffffff !important;
    z-index: 1040 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 16px !important;
}
body.theme-minimal .sidebar .sidebar-brand {
    flex-shrink: 0;
    padding: 0 16px 0 0 !important;
    border-bottom: none !important;
}
body.theme-minimal .sidebar .sidebar-user { display: none !important; }
body.theme-minimal .sidebar .sidebar-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex: 1;
    padding: 0 !important;
    gap: 2px;
}
body.theme-minimal .sidebar .menu-item { margin: 0 !important; }
body.theme-minimal .sidebar .menu-link {
    padding: 0 14px !important;
    height: 52px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap;
    border-radius: 0 !important;
    color: #6b7280 !important;
    font-size: 13px !important;
}
body.theme-minimal .sidebar .menu-link.active,
body.theme-minimal .sidebar .menu-link:hover {
    color: #111827 !important;
    background: #f9fafb !important;
    border-bottom: 2px solid #111827 !important;
}
body.theme-minimal .sidebar .menu-icon { display: none !important; }
body.theme-minimal .sidebar .menu-divider,
body.theme-minimal .sidebar .menu-section-title { display: none !important; }
body.theme-minimal .main-content {
    margin-left: 0 !important;
    padding-top: 68px !important;
    background: #f9fafb !important;
}
body.theme-minimal .card {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.06) !important;
    box-shadow: none !important;
    color: #111827 !important;
}
body.theme-minimal .card * { color: #111827 !important; }
body.theme-minimal .card .text-muted { color: #6b7280 !important; }

/* ══════════════════════════════════════════════════════════
   05. COLOR SIDEBAR — 아이콘 전용 좁은 사이드바 (60px)
   구조: 60px 아이콘 사이드바 / 호버 시 라벨 표시
   ══════════════════════════════════════════════════════════ */
body.theme-color-sidebar .sidebar {
    width: 64px !important;
    background: #4f46e5 !important;
    border-right: none !important;
    overflow: visible !important;
}
body.theme-color-sidebar .sidebar .brand-text,
body.theme-color-sidebar .sidebar .user-name,
body.theme-color-sidebar .sidebar .user-role,
body.theme-color-sidebar .sidebar .badge-role,
body.theme-color-sidebar .sidebar .menu-text,
body.theme-color-sidebar .sidebar .menu-divider,
body.theme-color-sidebar .sidebar .menu-section-title { display: none !important; }
body.theme-color-sidebar .sidebar .menu-link {
    justify-content: center !important;
    padding: 10px !important;
    border-radius: 8px !important;
    margin: 2px 8px !important;
    position: relative;
}
body.theme-color-sidebar .sidebar .menu-link:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #312e81;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 8px;
    z-index: 9999;
}
body.theme-color-sidebar .sidebar .menu-icon {
    background: rgba(255,255,255,.15) !important;
    color: #c7d2fe !important;
    margin: 0 !important;
}
body.theme-color-sidebar .sidebar .menu-link.active .menu-icon {
    background: rgba(255,255,255,.3) !important;
    color: #fff !important;
}
body.theme-color-sidebar .sidebar .user-avatar { margin: 0 auto !important; }
body.theme-color-sidebar .main-content {
    margin-left: 64px !important;
    background: #f3f4f6 !important;
}
body.theme-color-sidebar .card {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.08) !important;
    color: #111827 !important;
}
body.theme-color-sidebar .card * { color: #111827 !important; }
body.theme-color-sidebar .card .text-muted { color: #6b7280 !important; }

/* ══════════════════════════════════════════════════════════
   06. INSURANCE BLUE — 블루 사이드바 + 밝은 콘텐츠
   구조: 사이드바 좌측 / 콘텐츠 라이트 블루 배경
   ══════════════════════════════════════════════════════════ */
body.theme-insurance-blue { background: #eff6ff !important; }
body.theme-insurance-blue .sidebar { background: #1d4ed8 !important; border-right: none !important; }
body.theme-insurance-blue .sidebar .menu-link { color: rgba(255,255,255,.8) !important; }
body.theme-insurance-blue .sidebar .menu-link.active,
body.theme-insurance-blue .sidebar .menu-link:hover {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
}
body.theme-insurance-blue .sidebar .menu-icon { background: rgba(255,255,255,.15) !important; color: #93c5fd !important; }
body.theme-insurance-blue .sidebar .user-name { color: #fff !important; }
body.theme-insurance-blue .main-content { background: #eff6ff !important; }
body.theme-insurance-blue .card {
    background: #fff !important;
    border: 1px solid #dbeafe !important;
    color: #1e3a8a !important;
}
body.theme-insurance-blue .card * { color: #1e3a8a !important; }
body.theme-insurance-blue .card .text-muted { color: #6b7280 !important; }
body.theme-insurance-blue h1, body.theme-insurance-blue h2,
body.theme-insurance-blue h3, body.theme-insurance-blue h4 { color: #1e3a8a !important; }

/* ══════════════════════════════════════════════════════════
   07. SPLIT — 사이드바 오른쪽으로 이동
   구조: 콘텐츠 왼쪽 / 사이드바 오른쪽 240px
   ══════════════════════════════════════════════════════════ */
body.theme-split .sidebar {
    left: auto !important;
    right: 0 !important;
    background: #18181b !important;
    border-right: none !important;
    border-left: 1px solid rgba(255,255,255,.08) !important;
}
body.theme-split .main-content {
    margin-left: 0 !important;
    margin-right: 240px !important;
    background: #f8fafc !important;
}
body.theme-split .card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
body.theme-split .card * { color: #0f172a !important; }
body.theme-split .card .text-muted { color: #64748b !important; }
@media (max-width: 991px) {
    body.theme-split .main-content { margin-right: 0 !important; }
}

/* ══════════════════════════════════════════════════════════
   08. GRADIENT CARDS — 사이드바 숨김 + 풀와이드 + 그라데이션
   구조: 사이드바 없음 / 모바일 탑바처럼 / 그라데이션 카드
   ══════════════════════════════════════════════════════════ */
body.theme-gradient .sidebar { background: #312e81 !important; }
body.theme-gradient .sidebar .menu-link.active,
body.theme-gradient .sidebar .menu-link:hover { background: rgba(255,255,255,.15) !important; }
body.theme-gradient .sidebar .menu-icon { background: rgba(165,180,252,.2) !important; color: #a5b4fc !important; }
body.theme-gradient .main-content { background: #f5f3ff !important; }
body.theme-gradient .card {
    background: #fff !important;
    border: 1px solid #e0e7ff !important;
    color: #1e1b4b !important;
}
body.theme-gradient .card * { color: #1e1b4b !important; }
body.theme-gradient .card .text-muted { color: #6b7280 !important; }
/* 통계 카드에 그라데이션 적용 */
body.theme-gradient .stat-card:nth-child(1) { background: linear-gradient(135deg,#a855f7,#6366f1) !important; }
body.theme-gradient .stat-card:nth-child(2) { background: linear-gradient(135deg,#06b6d4,#3b82f6) !important; }
body.theme-gradient .stat-card:nth-child(3) { background: linear-gradient(135deg,#10b981,#059669) !important; }
body.theme-gradient .stat-card:nth-child(4) { background: linear-gradient(135deg,#f59e0b,#ef4444) !important; }
body.theme-gradient .stat-card { border: none !important; }
body.theme-gradient .stat-card * { color: #fff !important; }

/* ══════════════════════════════════════════════════════════
   09. TIMELINE GREEN — 사이드바 숨기고 좌측 탑바
   구조: 탑바 (미니멀과 유사) / 그린 포인트 / 클린 라이트
   ══════════════════════════════════════════════════════════ */
body.theme-timeline .sidebar {
    width: 100% !important; height: 50px !important;
    position: fixed !important; top: 0 !important;
    left: 0 !important; right: 0 !important;
    flex-direction: row !important; overflow: hidden !important;
    background: #064e3b !important;
    border-right: none !important;
    border-bottom: 2px solid #059669 !important;
    display: flex !important; align-items: center !important;
    padding: 0 16px !important;
}
body.theme-timeline .sidebar .sidebar-user,
body.theme-timeline .sidebar .menu-divider,
body.theme-timeline .sidebar .menu-section-title { display: none !important; }
body.theme-timeline .sidebar .sidebar-brand { flex-shrink: 0; padding: 0 16px 0 0 !important; border-bottom: none !important; }
body.theme-timeline .sidebar .sidebar-menu {
    display: flex !important; flex-direction: row !important;
    overflow-x: auto !important; flex: 1; padding: 0 !important;
}
body.theme-timeline .sidebar .menu-link {
    padding: 0 12px !important; height: 50px !important;
    display: flex !important; align-items: center !important;
    gap: 6px !important; white-space: nowrap;
    color: rgba(255,255,255,.75) !important; font-size: 13px !important;
    border-radius: 0 !important;
}
body.theme-timeline .sidebar .menu-link.active,
body.theme-timeline .sidebar .menu-link:hover {
    color: #fff !important; background: rgba(255,255,255,.1) !important;
    border-bottom: 3px solid #34d399 !important;
}
body.theme-timeline .sidebar .menu-icon { display: none !important; }
body.theme-timeline .main-content { margin-left: 0 !important; padding-top: 66px !important; background: #f0fdf4 !important; }
body.theme-timeline .card { background: #fff !important; border: 1px solid #d1fae5 !important; color: #064e3b !important; }
body.theme-timeline .card * { color: #064e3b !important; }
body.theme-timeline .card .text-muted { color: #6b7280 !important; }
body.theme-timeline h1, body.theme-timeline h2,
body.theme-timeline h3, body.theme-timeline h4 { color: #064e3b !important; }

/* ══════════════════════════════════════════════════════════
   10. DATA HUB — 아이콘 전용 사이드바 (52px) + 네이비 다크
   구조: 52px 아이콘 사이드바 / 네이비 배경 / 반투명 카드
   ══════════════════════════════════════════════════════════ */
body.theme-data-hub { background: #0c1a2e !important; }
body.theme-data-hub .sidebar {
    width: 52px !important;
    background: #020617 !important;
    border-right: 1px solid rgba(255,255,255,.06) !important;
    overflow: visible !important;
}
body.theme-data-hub .sidebar .brand-text,
body.theme-data-hub .sidebar .user-name,
body.theme-data-hub .sidebar .user-role,
body.theme-data-hub .sidebar .badge-role,
body.theme-data-hub .sidebar .menu-text,
body.theme-data-hub .sidebar .menu-divider,
body.theme-data-hub .sidebar .menu-section-title { display: none !important; }
body.theme-data-hub .sidebar .menu-link {
    justify-content: center !important;
    padding: 8px !important;
    border-radius: 6px !important;
    margin: 1px 6px !important;
}
body.theme-data-hub .sidebar .menu-icon { background: rgba(99,179,237,.12) !important; color: #63b3ed !important; margin: 0 !important; }
body.theme-data-hub .sidebar .menu-link.active .menu-icon,
body.theme-data-hub .sidebar .menu-link:hover .menu-icon { background: rgba(99,179,237,.25) !important; color: #90cdf4 !important; }
body.theme-data-hub .sidebar .user-avatar { margin: 0 auto !important; }
body.theme-data-hub .main-content { margin-left: 52px !important; background: #0c1a2e !important; }
body.theme-data-hub .card {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(99,179,237,.15) !important;
    color: #e2e8f0 !important;
}
body.theme-data-hub .card .text-muted { color: #94a3b8 !important; }
body.theme-data-hub h1, body.theme-data-hub h2,
body.theme-data-hub h3, body.theme-data-hub h4,
body.theme-data-hub p { color: #e2e8f0 !important; }

/* ══ 반응형: 탑바 테마에서 모바일 처리 ═══════════════════ */
@media (max-width: 991px) {
    body.theme-minimal .sidebar,
    body.theme-timeline .sidebar {
        height: auto !important;
        min-height: 50px;
        flex-wrap: wrap !important;
    }
    body.theme-minimal .sidebar .sidebar-menu,
    body.theme-timeline .sidebar .sidebar-menu {
        overflow-x: scroll !important;
        scrollbar-width: none;
    }
    body.theme-minimal .main-content,
    body.theme-timeline .main-content { padding-top: 70px !important; }
}
