:root {
    /* Prism 스펙트럼 색상 팔레트 */
    --prism-violet: #667eea;
    --prism-purple: #764ba2;
    --prism-pink: #f093fb;
    --prism-orange: #fda085;
    --prism-yellow: #ffd89b;
    --prism-blue: #4facfe;
    --prism-cyan: #00f2fe;
    
    /* 메인 색상 - Prism violet 기반 */
    --primary-color: #667eea;
    --primary-hover: #5a67d8;
    --primary-light: #EEF2FF;
    --primary-lighter: #F5F7FF;
    
    --secondary-color: #6B7280;  /* Gray */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    
    /* 배경색 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    
    /* 다크모드 색상 */
    --dark-bg-primary: #111827;
    --dark-bg-secondary: #1F2937;
    --dark-bg-tertiary: #374151;
    --dark-border: #4B5563;
    --dark-text-primary: #F9FAFB;
    --dark-text-secondary: #D1D5DB;
    
    /* 그림자 (더 부드럽게) */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 트랜지션 */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* 폰트 */
    --font-sans: 'Pretendard Variable', Pretendard, 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

/* 주요 계정 데이터 누락 경고 스타일 */
.account-name.has-missing-data {
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.1) 50%, transparent 100%);
    border-left: 3px solid var(--warning-color);
    padding-left: 12px;
}

.account-name.has-missing-data .account-name-container {
    display: flex;
    align-items: center;
}

.account-name.has-missing-data .fa-exclamation-triangle {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* 다크모드에서의 누락 경고 스타일 */
.dark-mode .account-name.has-missing-data {
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.2) 50%, transparent 100%);
    border-left-color: #FCD34D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, #FAFBFC 0%, #F3F4F6 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* 스크롤 스냅은 JavaScript로 처리 (60% 임계치) */

body.dark-mode {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: var(--dark-text-primary);
}

/* 메인 컨테이너 */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* 헤더 - 그라데이션 제거 */
.hero-header {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 60px 32px 40px;
    margin-bottom: 0;
    text-align: center;
    box-shadow: none;
}

.dark-mode .hero-header {
    background: transparent;
    border: none;
}

.hero-header h1 {
    /* Prism 스타일은 index.html에서 오버라이드 */
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.dark-mode .hero-header h1 {
    color: var(--dark-text-primary);
}

.hero-header .lead {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.dark-mode .hero-header .lead {
    color: var(--dark-text-secondary);
}

/* 검색 섹션 */
.search-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 32px 60px;
    margin-bottom: 32px;
    box-shadow: none;
    position: relative;
    z-index: 200;
}

.dark-mode .search-section {
    background: transparent;
    border: none;
}

/* 모드 전환 애니메이션 */
.hero-header,
.search-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-header.header-hidden,
.search-section.header-hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.hero-header.header-visible,
.search-section.header-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
    visibility: visible;
}

/* 모드 2에서 즉시 숨김 (애니메이션 없이) */
.hero-header.header-instant-hide,
.search-section.header-instant-hide {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    transition: none;
}

.search-section h3 {
    color: var(--text-primary);
    font-weight: 600;
}

.dark-mode .search-section h3 {
    color: var(--dark-text-primary);
}

/* 검색 래퍼 - 드롭다운 위치 기준 */
.search-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    z-index: 200;
}

/* 검색 입력 그룹 */
.search-input-group {
    position: relative;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
    border-radius: 50px;
    overflow: hidden;
    background: var(--bg-primary);
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .search-input-group {
    background: var(--dark-bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input-group:focus-within {
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 12px -3px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-color: var(--primary-color);
    transition: all 1000ms ease;
}

.search-input-group .input-group-text {
    background: transparent;
    border: none;
    border-right: none;
    padding: 14px 18px;
}

.dark-mode .search-input-group .input-group-text {
    background: transparent;
    border-color: var(--dark-border);
}

.search-input-group input {
    background: transparent;
    border: none;
    border-left: none;
    padding: 14px 4px 14px 0;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.dark-mode .search-input-group input {
    background: transparent;
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

.search-input-group input:focus {
    outline: none;
    background: transparent;
    border: none;
    box-shadow: none;
}

.search-input-group:focus-within .input-group-text {
    border: none;
    color: var(--primary-color);
}

.search-input-group input::placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-input-group .btn {
    border: none;
    border-radius: 0 50px 50px 0;
    font-weight: 500;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--prism-violet), var(--prism-purple));
    color: white;
    transition: all var(--transition-base);
}

.dark-mode .search-input-group .btn {
    background: linear-gradient(135deg, var(--prism-violet), var(--prism-purple));
    color: white;
}

.search-input-group .btn:hover {
    background: linear-gradient(135deg, var(--prism-purple), var(--prism-pink));
    transform: none;
}

.dark-mode .search-input-group .btn:hover {
    background: linear-gradient(135deg, var(--prism-purple), var(--prism-pink));
    transform: none;
}

/* 최근 검색 드롭다운 */
.recent-searches-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: fit-content;
    min-width: 220px;
    max-width: 340px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    overflow: hidden;
}

.dark-mode .recent-searches-dropdown {
    background: var(--dark-bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recent-search-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.recent-search-item:hover {
    background: var(--bg-secondary);
}

.recent-search-item:first-child {
    border-radius: 16px 16px 0 0;
}

.recent-search-item:last-child {
    border-radius: 0 0 16px 16px;
}

.recent-search-item:only-child {
    border-radius: 16px;
}

.recent-search-item .company-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.recent-search-item .stock-code {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 8px;
}

/* 최근 검색 삭제 버튼 */
.recent-search-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
    font-size: 0.75rem;
}

.recent-search-item:hover .recent-search-delete {
    opacity: 1;
}

.recent-search-delete:hover {
    color: var(--prism-pink);
    background: rgba(236, 72, 153, 0.1);
}

.dark-mode .recent-search-delete:hover {
    color: var(--prism-pink);
    background: rgba(236, 72, 153, 0.2);
}

/* 버튼 스타일 - Prism 효과 */
.btn-primary-minimal {
    background: linear-gradient(135deg, var(--prism-violet) 0%, var(--prism-purple) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px -3px rgba(102, 126, 234, 0.3);
}

.btn-primary-minimal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary-minimal:hover {
    background: linear-gradient(135deg, var(--prism-purple) 0%, var(--prism-pink) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(118, 75, 162, 0.4);
}

.btn-primary-minimal:hover::before {
    left: 100%;
}

.btn-secondary-minimal {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary-minimal:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* 회사 카드 */
.company-card {
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dark-mode .company-card {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.company-card:hover {
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.company-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-lighter);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.dark-mode .company-card.selected {
    background: var(--dark-bg-tertiary);
}

/* 검색 결과 없음 메시지 */
.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
}

.no-results-message i {
    font-size: 2.5rem;
    color: var(--danger-color);
    margin-bottom: 16px;
    opacity: 0.9;
}

.no-results-message p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-secondary);
}

.dark-mode .no-results-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.dark-mode .no-results-message p {
    color: var(--dark-text-secondary);
}

/* 재무 테이블 섹션 */
.financial-table {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.dark-mode .financial-table {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.table-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: 12px 12px 0 0;
}

/* 탭 컨테이너 - 테두리 박스 */
.tab-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 4px 16px;
    margin-bottom: 16px;
}

.dark-mode .tab-container {
    background: transparent;
    border-color: var(--dark-border);
}

/* 탭 네비게이션 - 언더라인 스타일 */
.nav-tabs {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

.dark-mode .nav-tabs {
    background: transparent;
}

.nav-tabs .nav-link {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-base);
}

.nav-tabs .nav-link:hover {
    background: transparent;
    color: var(--text-primary);
    border-bottom-color: #D1D5DB;
}

.dark-mode .nav-tabs .nav-link:hover {
    color: var(--dark-text-primary);
    border-bottom-color: #4B5563;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.dark-mode .nav-tabs .nav-link.active {
    color: #A78BFA;
    border-bottom-color: #A78BFA;
}

/* 탭 텍스트 - 데스크톱 기본값 */
.tab-text-short {
    display: none;
}

/* 재무제표 테이블 - 시인성 개선 */
.table-responsive {
    overflow: auto;
    max-height: 700px;
}

/* 테이블 스크롤 wrapper - 그라데이션 힌트용 */
.table-scroll-wrapper {
    position: relative;
}

/* 가로 스크롤 힌트 - 우측 그라데이션 페이드 */
.table-scroll-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px; /* 스크롤바 높이 제외 */
    width: 50px;
    background: linear-gradient(to left, var(--bg-primary) 0%, transparent 100%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 15;
}

/* 스크롤 끝 도달 시 페이드 숨김 */
.table-scroll-wrapper.scroll-end::after {
    opacity: 0;
}

/* 스크롤 불필요 시 (컨텐츠가 컨테이너보다 작을 때) 페이드 숨김 */
.table-scroll-wrapper.no-scroll::after {
    opacity: 0;
}

/* 다크모드 그라데이션 */
.dark-mode .table-scroll-wrapper::after {
    background: linear-gradient(to left, var(--dark-bg-secondary) 0%, transparent 100%);
}

.pivot-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.pivot-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pivot-table th {
    background: linear-gradient(180deg, #FAFBFC 0%, #F3F4F6 100%);
    color: var(--text-primary);
    padding: 16px 10px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--prism-violet);
    white-space: nowrap;
    position: relative;
    transition: all var(--transition-base);
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    text-transform: none;
    min-width: 100px;
}

.pivot-table th:hover {
    background: linear-gradient(180deg, #F5F7FF 0%, #EEF2FF 100%);
    color: var(--primary-color);
}

.dark-mode .pivot-table th {
    background: linear-gradient(180deg, #374151 0%, #1F2937 100%);
    color: var(--dark-text-primary);
    border-bottom: 2px solid var(--prism-cyan);
}

.dark-mode .pivot-table th:hover {
    background: linear-gradient(180deg, #4B5563 0%, #374151 100%);
    color: var(--prism-cyan);
}

.pivot-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 21;
    width: 220px;
    text-align: left;
    padding-left: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    text-transform: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--prism-purple);
}

.dark-mode .pivot-table th:first-child {
    background: var(--dark-bg-secondary);
    border-right: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--prism-cyan);
}

/* 최신 데이터 컬럼 강조 */
.pivot-table th.latest-data {
    position: relative;
    background: linear-gradient(180deg, #F5F7FF 0%, #EEF2FF 100%);
    border-bottom: 3px solid var(--prism-violet);
}

.dark-mode .pivot-table th.latest-data {
    background: linear-gradient(180deg, #4B5563 0%, #374151 100%);
    border-bottom: 3px solid var(--prism-cyan);
}

.pivot-table th.latest-data::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--prism-violet);
    border-radius: 2px;
}

.dark-mode .pivot-table th.latest-data::before {
    background: var(--prism-cyan);
}

.pivot-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--bg-primary);
    border-left: 1px solid rgba(0, 0, 0, 0.03);
}

.pivot-table td:first-child {
    border-left: none;
}

.dark-mode .pivot-table td {
    background: var(--dark-bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--dark-text-primary);
}

.dark-mode .pivot-table td:first-child {
    border-left: none;
}

.pivot-table tbody tr:hover td {
    background: var(--bg-tertiary);
}

.dark-mode .pivot-table tbody tr:hover td {
    background: var(--dark-bg-tertiary);
}

/* 계정과목 열 고정 및 시인성 개선 */
.pivot-table td.account-name {
    position: sticky;
    left: 0;
    z-index: 10;
    background: linear-gradient(90deg, #FAFBFC 0%, var(--bg-primary) 100%);
    font-weight: 500;
    min-width: 200px;
    max-width: 250px;
    padding-left: 20px;
    padding-right: 12px;
    border-right: 1px solid rgba(102, 126, 234, 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dark-mode .pivot-table td.account-name {
    background: linear-gradient(90deg, var(--dark-bg-tertiary) 0%, var(--dark-bg-secondary) 100%);
    border-right: 1px solid rgba(0, 242, 254, 0.15);
    color: var(--dark-text-primary);
}

/* 계정과목 내부 텍스트 스타일 */
.account-name-normalized {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 500;
}

.dark-mode .account-name-normalized {
    color: var(--dark-text-primary);
}

.account-name-normalized.priority {
    color: var(--primary-color);
    font-weight: 600;
}

/* 우선순위 계정과목 스타일 */
.pivot-table td.account-name.priority {
    background: var(--primary-lighter);
    border-left: 3px solid var(--primary-color);
    font-weight: 600;
}

.dark-mode .pivot-table td.account-name.priority {
    background: rgba(79, 70, 229, 0.1);
}

/* 우선순위 표시기 */
.priority-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

/* 계정과목 컨테이너 */
.account-name-container {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.account-name-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 금액 셀 */
.pivot-table td.amount-cell {
    text-align: right;
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.dark-mode .pivot-table td.amount-cell {
    color: var(--dark-text-primary);
}

/* V차트 카테고리 버튼 - 심플하게 */
.v-category-btn {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 12px;
    transition: all var(--transition-base);
    font-weight: 500;
}

.dark-mode .v-category-btn {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

.v-category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-lighter);
}

.dark-mode .v-category-btn:hover {
    background: rgba(79, 70, 229, 0.1);
}

.v-category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* V차트 컨테이너 */
.v-chart-content {
    padding: 30px 20px;  /* 좌우 20px 여백 추가 */
}

/* V차트 카테고리 콘텐츠 - 부모 탭 패널 상태에 의존 */
.v-category-content {
    display: none !important;  /* 기본적으로 모든 V차트 콘텐츠 숨김 */
    padding: 0 15px;  /* 추가 내부 여백 */
}

/* V차트 탭이 활성화(show)되었을 때만 active 카테고리 콘텐츠 표시 */
.tab-pane#v-chart.show .v-category-content.active {
    display: block !important;
}

/* V차트 탭이 show되지 않으면 모든 카테고리 콘텐츠 강제 숨김 */
.tab-pane#v-chart:not(.show) .v-category-content {
    display: none !important;
}

/* V차트 카드 - 크기 최적화 */
.chart-preview-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    height: 320px;  /* 280px → 320px로 높이 증가 */
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.dark-mode .chart-preview-card {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.chart-preview-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.chart-preview-header {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.chart-preview-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;  /* 살짝 크게 */
    margin-bottom: 4px;
}

.dark-mode .chart-preview-header h6 {
    color: var(--dark-text-primary);
}

.chart-preview-header small {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.chart-preview-body {
    flex: 1;
    position: relative;
    min-height: 220px;  /* 180px → 220px로 증가 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.chart-preview-body canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* V차트 섹션 내부 여백 */
#v-chart .table-info {
    margin: 0 20px 20px 20px;
}

/* 반응형 그리드 조정 */
@media (min-width: 1400px) {
    /* 큰 화면에서는 여전히 2열 유지 (3열은 너무 작음) */
    .v-category-content .row > .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .chart-preview-card {
        height: 340px;  /* 큰 화면에서는 더 크게 */
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    /* 중간 화면에서는 2열 */
    .v-category-content .row > .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .chart-preview-card {
        height: 320px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    /* 태블릿에서도 2열 */
    .v-category-content .row > .col-lg-6,
    .v-category-content .row > .col-md-12 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .chart-preview-card {
        height: 300px;
    }
}

@media (max-width: 767px) {
    /* 모바일에서는 1열 */
    .v-category-content .row > .col-lg-6,
    .v-category-content .row > .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 4px;
        padding-right: 4px;
    }

    .v-category-content {
        padding: 0;
    }

    .v-category-content .row {
        margin-left: 0;
        margin-right: 0;
    }

    .chart-preview-card {
        height: auto;
        min-height: 220px;
        padding: 4px;
        cursor: default;
        border-radius: 4px;
    }

    .chart-preview-card:hover {
        transform: none;
        box-shadow: none;
    }

    .chart-preview-header {
        margin-bottom: 2px;
        padding: 0 4px;
    }

    .chart-preview-header h6 {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .chart-preview-header small {
        display: none; /* 모바일에서 영어 부제목 숨김 */
    }

    .chart-preview-body {
        padding: 2px;
        min-height: 180px;
        margin: 0;
    }

    .v-chart-content {
        padding: 4px 0;
    }

    #v-chart .table-info {
        margin: 0 4px 4px 4px;
    }
}

/* 플로팅 버튼 - 심플하게 */
.floating-action-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 1000;
}

.floating-action-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

#scrollToTop {
    bottom: 80px;
    right: 24px;
}

.scroll-to-top {
    opacity: 0;
    visibility: hidden;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 설정 드롭다운 위치 */
#settingsDropdown {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

/* 설정 버튼 - 부모(settingsDropdown)에서 위치 관리 */
#settingsButton {
    position: relative;
    bottom: auto;
    right: auto;
    overflow: hidden;
}

.settings-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* 모바일 전용 스타일 */
@media (max-width: 768px) {
    /* 인기검색어 항상 숨김 */
    #popularSearches {
        display: none !important;
    }

    /* 금액 단위 토글 숨김 (기본 억원) */
    #unitToggleGroup {
        display: none !important;
    }

    /* 탭 텍스트 약어 표시 (아이콘, 전체 텍스트 숨김) */
    .tab-text-full,
    .tab-icon {
        display: none !important;
    }
    .tab-text-short {
        display: inline !important;
    }

    /* 탭 한 줄 고정 */
    #statementTabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    #statementTabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    #statementTabs .nav-item {
        flex-shrink: 0;
    }
    #statementTabs .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* 재무제표 첫 번째 컬럼(계정과목) 너비 제한 */
    .pivot-table th:first-child,
    .pivot-table td:first-child {
        max-width: 90px;
        width: 90px;
        min-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-left: 8px;
        padding-right: 4px;
        font-size: 0.8rem;
    }

    /* 플로팅 버튼 크기 축소 */
    .floating-action-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    #settingsDropdown {
        bottom: 16px;
        right: 16px;
    }

    #scrollToTop {
        bottom: 64px;
        right: 16px;
    }
}

/* 로딩 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.dark-mode .loading-content {
    background: var(--dark-bg-secondary);
}

.spinner-border {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: prism-spin 1s linear infinite !important;
}

@keyframes prism-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 모달 */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.dark-mode .modal-content {
    background: var(--dark-bg-secondary);
    color: var(--dark-text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.dark-mode .modal-header {
    border-bottom-color: var(--dark-border);
}

.modal-body {
    padding: 24px;
}

/* 차트 상세보기 모달 특별 스타일 */
#chartDetailModal .modal-dialog {
    max-width: 1000px;  /* xl보다 작게 조정 */
}

#chartDetailModal .modal-dialog-centered {
    min-height: calc(100% - 3rem);
    display: flex;
    align-items: center;
}

#chartDetailModal .modal-content {
    max-height: 90vh;  /* 뷰포트 높이의 90%로 제한 */
    overflow: hidden;
}

#chartDetailModal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);  /* 헤더 높이 제외 */
}

#chartDetailCanvas {
    display: block;
    max-width: 100%;
}

/* 차트 정보 카드 */
.chart-info,
.chart-data {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
}

.dark-mode .chart-info,
.dark-mode .chart-data {
    background: var(--dark-bg-tertiary);
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: var(--dark-bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 유틸리티 클래스 */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* 반응형 */
@media (max-width: 768px) {
    .main-container {
        padding: 16px;
    }
    
    .hero-header {
        padding: 32px 20px;
    }
    
    .hero-header h1 {
        font-size: 1.75rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    
    .pivot-table {
        font-size: 0.8125rem;
    }
    
    .floating-action-btn {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }
}

/* 애니메이션 설정 감소 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ==================== 메모 탭 스타일 ==================== */

.memo-container {
    padding: 20px;
}

/* 메모 기업 목록 패널 */
.memo-list-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: calc(100vh - 420px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.memo-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.memo-list-header h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.memo-list-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* 메모 기업 아이템 */
.memo-company-item {
    padding: 14px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 8px;
    border: 1px solid transparent;
    background: var(--bg-secondary);
}

.memo-company-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.memo-company-item.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.memo-company-item.current::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.memo-company-item {
    position: relative;
}

.memo-company-item .company-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

/* 빈 상태 */
.memo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

/* 메모 편집기 패널 */
.memo-editor-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.memo-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.memo-editor-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0;
}

.memo-metadata {
    display: flex;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.memo-metadata .memo-date::before {
    content: '\f073';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    margin-right: 6px;
}

.memo-metadata .memo-price::before {
    content: '\f3d1';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 6px;
}

.memo-editor-body {
    margin-bottom: 20px;
}

.memo-editor-body textarea {
    resize: vertical;
    min-height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.memo-editor-body textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.memo-editor-footer {
    display: flex;
    gap: 12px;
}

/* 메모 히스토리 */
.memo-history {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.memo-history h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.memo-history-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.memo-history-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.memo-history-item.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.memo-history-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.memo-history-price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.memo-history-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 메모 버튼 그룹 */
.memo-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 메모 인라인 토스트 */
.memo-toast-inline {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.memo-toast-inline.show {
    opacity: 1;
    transform: translateX(0);
}

.memo-toast-inline.success {
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.memo-toast-inline.error {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.memo-toast-inline.warning {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.memo-toast-inline.info {
    color: var(--info-color);
    background: rgba(59, 130, 246, 0.1);
}

.memo-toast-inline i {
    margin-right: 6px;
}

/* 모바일 반응형 */
@media (max-width: 576px) {
    .memo-btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .memo-btn-group .btn {
        width: 100%;
    }

    .memo-toast-inline {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

/* 다크모드 지원 */
.dark-mode .memo-list-panel,
.dark-mode .memo-editor-panel {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

.dark-mode .memo-list-header {
    background: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
}

.dark-mode .memo-list-header h6,
.dark-mode .memo-editor-header h6,
.dark-mode .memo-history h6 {
    color: var(--dark-text-primary);
}

.dark-mode .memo-company-item {
    background: var(--dark-bg-tertiary);
}

.dark-mode .memo-company-item:hover {
    background: var(--dark-bg-primary);
}

.dark-mode .memo-company-item.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.dark-mode .memo-company-item .company-name {
    color: var(--dark-text-primary);
}

.dark-mode .memo-editor-header {
    border-color: var(--dark-border);
}

.dark-mode .memo-editor-body textarea {
    background: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

.dark-mode .memo-editor-body textarea:focus {
    border-color: var(--primary-color);
}

.dark-mode .memo-history {
    border-color: var(--dark-border);
}

.dark-mode .memo-history-item {
    background: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
}

.dark-mode .memo-history-item:hover {
    background: var(--dark-bg-primary);
}

.dark-mode .memo-history-item.selected {
    background: rgba(102, 126, 234, 0.2);
}

.dark-mode .memo-history-content {
    color: var(--dark-text-primary);
}

.dark-mode .memo-history-date {
    color: var(--dark-text-secondary);
}

/* 반응형 */
@media (max-width: 768px) {
    .memo-container {
        padding: 12px;
    }

    .memo-list-panel {
        height: auto;
        min-height: 200px;
        max-height: 300px;
        margin-bottom: 16px;
    }

    .memo-editor-panel {
        padding: 16px;
    }

    .memo-editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .memo-metadata {
        flex-direction: column;
        gap: 4px;
    }

    .memo-editor-footer {
        flex-wrap: wrap;
    }

    .memo-editor-footer .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* ========================================
   Sticky 헤더 스타일
   ======================================== */

/* 기업명 + 옵션 헤더 - sticky 고정 */
.table-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 12px 12px 0 0;
}

/* 탭 네비게이션 - sticky 고정 */
#statementTabs {
    position: sticky;
    top: 72px; /* table-header(56px) + 간격(16px) */
    z-index: 99;
    background: var(--bg-primary);
    margin: 16px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    #statementTabs {
        margin: 8px;
        top: 52px;
    }
}

.dark-mode #statementTabs {
    background: var(--dark-bg-primary);
}

/* ========================================
   Sticky 헤더 기업명/검색 그룹
   ======================================== */

.company-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 주가/시가총액 배지 */
.stock-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .stock-price-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
        margin-left: 8px;
    }
}

/* 모바일 미니 로고 (JavaScript에서 display 제어) */
.mini-logo {
    display: none;
    font-weight: 700;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-left: 8px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.sticky-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticky-search-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.sticky-search-group:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.sticky-search-input {
    border: none;
    padding: 8px 14px;
    width: 200px;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: white;
    outline: none;
}

.sticky-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.sticky-search-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sticky-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   옵션 그룹 (버튼 스타일)
   ======================================== */

.header-options {
    display: flex;
    align-items: center;
    gap: 16px;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.option-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.option-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.option-btn.active {
    background: white;
    color: #5B5FDE;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 연환산 체크박스 */
.option-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.option-checkbox input {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    margin: 0;
}

.option-checkbox input:checked {
    background: rgba(255, 255, 255, 0.9);
    border-color: white;
}

.option-checkbox input:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: solid #1a365d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.option-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 반응형 옵션 그룹 */
@media (max-width: 992px) {
    .header-options {
        gap: 8px;
    }

    .option-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .option-checkbox {
        padding: 5px 8px;
        font-size: 12px;
    }

    .sticky-search-input {
        width: 160px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* iOS 자동 확대 방지 (16px 미만 시 확대됨) */
    input, textarea, select {
        font-size: 16px !important;
    }

    .sticky-search-group {
        flex: 1;
        min-width: 120px;
    }

    .sticky-search-input {
        width: 100%;
    }

    .header-options {
        flex-wrap: wrap;
    }
}

/* 기능 잠금 상태 */
.feature-locked {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.feature-locked:hover {
    opacity: 0.6;
}

/* ==================== 커스텀 계정 매핑 ==================== */

/* 매핑 모드 활성화 시 커서 */
.pivot-table.mapping-enabled td.amount-cell {
    cursor: cell;
    user-select: none;
}

/* 드래그로 선택된 셀 */
.pivot-table td.cell-selected {
    background-color: rgba(103, 58, 183, 0.2) !important;
    outline: 2px solid var(--prism-violet);
    outline-offset: -2px;
}

/* 선택 중인 행 (계정명 셀) */
.pivot-table tr.row-selecting td.account-name {
    background-color: rgba(103, 58, 183, 0.1) !important;
}

/* 계정명 셀 hover - 전역 매핑용 (관리자만 활성화) */
.pivot-table td.account-name {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pivot-table td.account-name:hover {
    background-color: rgba(23, 162, 184, 0.1) !important;
}

/* Pending 매핑 패널 */
.pending-mapping-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 450px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.pending-mapping-panel .panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.pending-mapping-panel .panel-header h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.pending-mapping-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 300px;
}

.pending-mapping-panel .panel-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}

/* 개별 pending 항목 */
.pending-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--prism-violet);
    position: relative;
    transition: all var(--transition-fast);
}

.pending-item:hover {
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pending-item:last-child {
    margin-bottom: 0;
}

.pending-item .mapping-info {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding-right: 24px;
}

.pending-item .source-account {
    color: var(--text-secondary);
    font-family: 'Pretendard', -apple-system, sans-serif;
}

.pending-item .target-account {
    color: var(--prism-violet);
    font-weight: 600;
}

.pending-item .period-info {
    margin-top: 6px;
}

.pending-item .remove-mapping {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 6px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.pending-item .remove-mapping:hover {
    opacity: 1;
}

/* 매핑 모달 스타일 */
#customMappingModal .form-control.bg-light {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

#customMappingModal .form-select {
    border: 1px solid var(--border-color);
}

#customMappingModal .form-select:focus {
    border-color: var(--prism-violet);
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.15);
}

#mappingPreview {
    background-color: rgba(103, 58, 183, 0.08);
    border: 1px solid rgba(103, 58, 183, 0.2);
    border-radius: 8px;
}

#mappingPreviewJson {
    background: transparent;
    color: var(--text-primary);
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* 모바일 대응 */
@media (max-width: 767px) {
    .pending-mapping-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 10px;
        max-height: 350px;
    }

    .pending-item .mapping-info {
        font-size: 0.85rem;
    }
}


/* DART Clickable Header */
.clickable-header {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.clickable-header::after {
    content: '\2197';
    font-size: 0.7em;
    opacity: 0.4;
    margin-left: 2px;
    transition: opacity 0.2s ease;
}

.clickable-header:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    color: var(--prism-violet) !important;
}

.clickable-header:hover::after {
    opacity: 1;
}

.dark-mode .clickable-header:hover {
    background-color: rgba(102, 126, 234, 0.2) !important;
}

/* ===== Notify 통합 알림 ===== */
#notifyContainer {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notify-toast {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: notifyIn 0.3s ease-out;
}

.notify-toast.notify-out {
    animation: notifyOut 0.3s ease-out forwards;
}

.notify-toast i { margin-right: 8px; font-size: 1rem; }
.notify-toast span { flex: 1; }

.notify-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 12px;
    opacity: 0.6;
    color: inherit;
    line-height: 1;
}
.notify-close:hover { opacity: 1; }

.notify-success {
    color: var(--success-color, #10B981);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.notify-error {
    color: var(--danger-color, #EF4444);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.notify-warning {
    color: var(--warning-color, #F59E0B);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.notify-info {
    color: var(--info-color, #3B82F6);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes notifyIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes notifyOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 576px) {
    #notifyContainer {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
