/* Light 테마용 기본 푸터 색상 */
footer {
    background: #fff !important;
    border-top: 1px solid #e5e7eb;
    padding: 16px 24px;
    color: #6b7280;
}
/* Dark 테마용 어두운 푸터 */
[data-bs-theme="dark"] footer {
    background: #1e2022 !important;
    border-top: 1px solid #374151;
    color: #9ca3af;
}
/* Handsontable 그리드 상단 타이틀과 마진 */
.hansontablemargin {
    margin-top: 0.9px;
}
/* Handsontable 컨테이너 하단 여백 */
.hansontablemargin .wtHolder {
    padding-bottom: 8px;
}

/* Handsontable Row 텍스트 세로 중앙 정렬 */
.hansontablemargin td {
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ==================== Handsontable Dark Theme ==================== */

/* Dark 테마 - 테이블 전체 및 빈 여백(.wtHolder) 배경·텍스트 */
[data-bs-theme="dark"] .hw-table-container,
[data-bs-theme="dark"] .handsontable,
[data-bs-theme="dark"] .handsontable .wtHolder,
[data-bs-theme="dark"] .handsontable .ht_master {
    background-color: #1e2022 !important;
    color: #e5e7eb !important;
}

/* Dark 테마 - 셀 배경 */
[data-bs-theme="dark"] .handsontable td {
    background-color: #1e2022 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

/* Dark 테마 - 헤더 */
[data-bs-theme="dark"] .handsontable th {
    background-color: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

/* Dark 테마 - 헤더 호버 */
[data-bs-theme="dark"] .handsontable th:hover {
    background-color: #4b5563 !important;
}

/* Dark 테마 - Row 헤더 */
[data-bs-theme="dark"] .handsontable .ht__manualRowMove,
[data-bs-theme="dark"] .handsontable tbody th {
    background-color: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

/* Dark 테마 - 선택된 셀 */
[data-bs-theme="dark"] .handsontable td.area {
    background-color: #374151 !important;
}

[data-bs-theme="dark"] .handsontable td.current {
    background-color: #4b5563 !important;
}

/* Dark 테마 - 호버 행 */
[data-bs-theme="dark"] .handsontable tr:hover td {
    background-color: #2d3748 !important;
}

/* Dark 테마 - 선택된 행 */
[data-bs-theme="dark"] .handsontable .ht__highlight {
    background-color: #374151 !important;
}

/* Dark 테마 - 정렬 아이콘 */
[data-bs-theme="dark"] .handsontable .changeType {
    color: #e5e7eb !important;
}

/* Dark 테마 - 드롭다운 메뉴 */
[data-bs-theme="dark"] .handsontable .htDropdownMenu {
    background-color: #1e2022 !important;
    border-color: #374151 !important;
}

[data-bs-theme="dark"] .handsontable .htDropdownMenu tbody td {
    color: #e5e7eb !important;
}

[data-bs-theme="dark"] .handsontable .htDropdownMenu tbody td:hover {
    background-color: #374151 !important;
}

/* Dark 테마 - 컨텍스트 메뉴 */
[data-bs-theme="dark"] .handsontable .htContextMenu {
    background-color: #1e2022 !important;
    border-color: #374151 !important;
}

[data-bs-theme="dark"] .handsontable .htContextMenu tbody td {
    color: #e5e7eb !important;
}

[data-bs-theme="dark"] .handsontable .htContextMenu tbody td:hover {
    background-color: #374151 !important;
}

/* Dark 테마 - 스크롤바 (Webkit 브라우저) */
[data-bs-theme="dark"] .handsontable .wtHolder::-webkit-scrollbar {
    background-color: #1e2022;
}

[data-bs-theme="dark"] .handsontable .wtHolder::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 4px;
}

[data-bs-theme="dark"] .handsontable .wtHolder::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Dark 테마 - 버튼 스타일 유지 */
[data-bs-theme="dark"] .handsontable td button.btn-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .handsontable td button.btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

/* 입력창 강조 클래스 */
.input-highlight {
    border: 1px solid #0d6efd;
    background-color: #f8f9ff;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.input-highlight:focus {
    border-color: #0b5ed7;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
    background-color: #ffffff;
    outline: none;
}

[data-bs-theme="dark"] .input-highlight {
    border: 1px solid #3b82f6;
    background-color: #1e2433;
    color: #eff2f6;
}

[data-bs-theme="dark"] .input-highlight:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 .2rem rgba(59,130,246,.25);
    background-color: #141824;
    color: #ffffff;
    outline: none;
}

.selectbox_width {
    width: 200px;
}
.search-box-lable {
    padding-top: calc(0.4rem + var(--phoenix-border-width));
}
.input-group-text-flatpick {
    padding: 0.5rem 0.5rem;
}
:root:not([data-bs-theme="dark"]) .handsonRowYellow {
    background-color: #ffeb3b !important;
}
:root:not([data-bs-theme="dark"]) .handsonRowGray {
    background-color: #e0e0e0 !important;
}
.handsonText-Center {
    text-align: center !important;
}

/* 사이드바 하위 메뉴 노출 보정 */
.navbar-vertical .parent-wrapper {
    display: block !important;
}
.navbar-vertical .nav.collapse.parent.show {
    display: block !important;
}
.navbar-vertical .nav.collapse.parent .nav-link {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.navbar-vertical .nav.collapse.parent .nav-link-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 라이트/다크 모드별 요약표 강조 셀 구분 */
:root:not([data-bs-theme="dark"]) .handsontable td.bg-warning-subtle { background-color: #fff3cd !important; color: #664d03 !important; }
:root:not([data-bs-theme="dark"]) .handsontable td.bg-success-subtle { background-color: #d1e7dd !important; color: #0f5132 !important; }
:root:not([data-bs-theme="dark"]) .handsontable td.bg-info-subtle { background-color: #cff4fc !important; color: #055160 !important; }
:root:not([data-bs-theme="dark"]) .handsontable td.bg-primary-subtle { background-color: #cfe2ff !important; color: #084298 !important; }
:root:not([data-bs-theme="dark"]) .handsontable td.bg-danger-subtle { background-color: #f8d7da !important; color: #842029 !important; }
:root:not([data-bs-theme="dark"]) .handsontable td.bg-secondary-subtle { background-color: #e2e3e5 !important; color: #41464b !important; }
