/* 모달 배경 오버레이 — inline 차트 모드에서는 사용 안 함 */
.modal-overlay {
    display: none !important;
}

/* 인라인 차트 영역 — 카드 그리드와 페이지네이션 사이에 표시 */
.inline-chart-section {
    margin: 24px 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}
.inline-chart-section.active {
    display: block;
}
.inline-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.inline-chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}
.inline-chart-section .slide-content {
    padding: 20px 24px;
}
.inline-chart-section .btn-close-slide {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inline-chart-section .btn-close-slide:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* 오른쪽 슬라이드 패널 스타일 */
.slide-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 55vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    border-radius: 16px 0 0 16px;
    z-index: 1001;
    overflow: hidden;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
    display: flex;
    flex-direction: column;
}

.slide-modal.active {
    transform: translateX(0);
    visibility: visible;
}

.slide-modal::-webkit-scrollbar {
    width: 6px;
}

.slide-modal::-webkit-scrollbar-thumb {
    background: #EAECEF;
    border-radius: 3px;
}

.slide-modal::-webkit-scrollbar-track {
    background: transparent;
}

.slide-header {
    background: #ffffff;
    padding: 18px 28px;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #4a90d9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slide-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    font-family: var(--Score);
}

/* 검색 필터 */
.search-filters-wrap {
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.search-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-filter-item label {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
}

.search-filter-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 160px;
    background: #ffffff;
    color: #272f3c;
    transition: border-color 0.2s ease;
}

.search-filter-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.search-filter-input::placeholder {
    color: #9ca3af;
}

.btn-search-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    height: 34px;
    transition: background 0.2s ease;
}

.btn-search-filter:hover {
    background: #357abd;
}

.search-filter-date .search-filter-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-filter-date .search-filter-input {
    width: 120px;
}

.search-filter-date-sep {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.btn-close-slide {
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.btn-close-slide:hover {
    background: #e5e7eb;
}

.btn-close-slide svg {
    width: 20px;
    height: 20px;
    stroke: #374151;
    transition: all 0.2s ease;
}

.btn-close-slide:hover svg {
    stroke: #111827;
    transform: rotate(90deg);
}

.slide-content {
    padding: 24px 28px 40px;
    background: #f9fafb;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.content-flex {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.chart-section {
    min-width: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.table-section {
    min-width: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modal-image-wrap {
    width: 100%;
    margin-bottom: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    background: #ffffff;
    padding: 16px;
    min-height: 420px;
    height: auto;
    box-sizing: border-box;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #374151;
    font-family: var(--Score);
    padding-bottom: 0;
    border-bottom: none;
    position: relative;
    padding-left: 12px;
}

.stats-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: #4a90d9;
}

.stats-data {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stats-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.stats-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-table tbody tr {
    background: #ffffff;
    transition: background-color 0.15s ease;
}

.stats-table tbody tr:hover {
    background: #f9fafb;
}

.stats-table tbody td:first-child {
    font-weight: 500;
    color: #272f3c;
}

.total-row {
    background: #f0f4ff !important;
    font-weight: 600 !important;
}

.total-row td {
    color: #272f3c !important;
    font-weight: 600 !important;
    border-bottom: none !important;
}

.total-row td:first-child {
    color: var(--color-green) !important;
}

/* 모달 추가 정보 섹션 */
.modal-info-section {
    margin-top: 32px;
    padding: 20px;
    background: #DBE9FF;
    border-radius: 12px;
    border: 1px solid #EAECEF;
}

.modal-info-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #272f3c;
    margin-bottom: 12px;
    font-family: var(--Score);
}

.modal-info-section p {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.6;
}

/* 모달 액션 버튼 */
.modal-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
}

.modal-actions button {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--Score);
}

.modal-actions .btn-primary {
    background: var(--color-green);
    color: #ffffff;
    border: none;
}

.modal-actions .btn-primary:hover {
    background: #008a32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 167, 60, 0.3);
}

.modal-actions .btn-secondary {
    background: #ffffff;
    color: var(--color-blue);
    border: 2px solid #DBE9FF;
}

.modal-actions .btn-secondary:hover {
    background: #DBE9FF;
    color: var(--color-blue);
    transform: translateY(-2px);
}

/* 모달 내부 날짜 검색 영역 */
.xAxisDate {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border-bottom: none;
    margin: 0 0 16px 0;
}

.xAxisDate input[type="text"] {
    width: 160px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #272f3c;
    transition: border-color 0.2s ease;
}

.xAxisDate input[type="text"]:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.xAxisDate input[type="text"]::placeholder {
    color: #9ca3af;
}

.xAxisDate .btn-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: #4a90d9;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 34px;
}

.xAxisDate .btn-search:hover {
    background: #357abd;
}

.xAxisDate .btn-search svg {
    width: 16px;
    height: 16px;
}

/* 날짜 구분자 스타일 */
.xAxisDate > span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    margin: 0 4px;
}

/* 한국형 Datepicker 커스텀 스타일 */
.korean-datepicker {
    font-family: var(--Score), 'Noto Sans KR', sans-serif !important;
}

.ui-datepicker {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 350px;
}

.ui-datepicker-header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 16px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.ui-datepicker-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.ui-datepicker-title select {
    background: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--Score);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #333;
}

.ui-datepicker-title select:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ui-datepicker-title select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* 년도 선택 드롭다운 */
.ui-datepicker-year {
    min-width: 80px;
    text-align: center;
}

/* 월 선택 드롭다운 */
.ui-datepicker-month {
    min-width: 70px;
    text-align: center;
}

/* 이전/다음 버튼 */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.2s ease;
    top: 16px;
    width: auto;
    height: auto;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.ui-datepicker .ui-datepicker-prev {
    left: 12px;
}

.ui-datepicker .ui-datepicker-next {
    right: 12px;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    background-position: center;
    background-size: 80%;
}

/* 한국어 텍스트 정렬 */
.ui-datepicker .ui-datepicker-title {
    line-height: 1.8;
}

/* 달력 테이블 스타일 */
.ui-datepicker-calendar {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}

.ui-datepicker-calendar thead th {
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-align: center;
    border-bottom: 2px solid #EAECEF;
}

/* 일요일 */
.ui-datepicker-calendar thead th:first-child {
    color: #E53E3E;
}

/* 토요일 */
.ui-datepicker-calendar thead th:last-child {
    color: #3182CE;
}

.ui-datepicker-calendar tbody td {
    padding: 2px;
    text-align: center;
}

.ui-datepicker-calendar tbody td a,
.ui-datepicker-calendar tbody td span {
    display: block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 auto;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* 일요일 날짜 */
.ui-datepicker-calendar tbody td:first-child a,
.ui-datepicker-calendar tbody td:first-child span {
    color: #E53E3E;
}

/* 토요일 날짜 */
.ui-datepicker-calendar tbody td:last-child a,
.ui-datepicker-calendar tbody td:last-child span {
    color: #3182CE;
}

/* 선택 가능한 날짜 hover */
.ui-datepicker-calendar tbody td a:hover {
    background: #F7FAFC;
    color: #4A90E2;
    transform: scale(1.1);
}

/* 선택된 날짜 */
.ui-datepicker-calendar tbody td.ui-datepicker-current-day a,
.ui-datepicker-calendar tbody td.ui-datepicker-today a {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

/* 오늘 날짜 표시 */
.ui-datepicker-calendar tbody td.ui-datepicker-today a {
    background: #F7FAFC;
    color: #4A90E2;
    font-weight: 600;
    border: 2px solid #4A90E2;
}

/* 선택된 오늘 날짜 */
.ui-datepicker-calendar tbody td.ui-datepicker-current-day.ui-datepicker-today a {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #ffffff;
    border: none;
}

/* 다른 달의 날짜 */
.ui-datepicker-calendar tbody td.ui-datepicker-other-month span {
    color: #CBD5E0;
}

/* 버튼 패널 (오늘, 닫기) */
.ui-datepicker-buttonpane {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #EAECEF;
}

.ui-datepicker-buttonpane button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--Score);
}

.ui-datepicker-buttonpane button.ui-datepicker-current {
    background: #4A90E2;
    color: #ffffff;
}

.ui-datepicker-buttonpane button.ui-datepicker-current:hover {
    background: #357ABD;
    transform: translateY(-1px);
}

.ui-datepicker-buttonpane button.ui-datepicker-close {
    background: #E2E8F0;
    color: #4A5568;
}

.ui-datepicker-buttonpane button.ui-datepicker-close:hover {
    background: #CBD5E0;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .ui-datepicker {
        min-width: 260px;
        padding: 16px;
    }

    .ui-datepicker-header {
        padding: 14px 10px;
    }

    .ui-datepicker-title select {
        padding: 6px 10px;
        font-size: 14px;
    }

    .ui-datepicker-calendar tbody td a,
    .ui-datepicker-calendar tbody td span {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
    }
}