/* Custom Setting Container Styles to make it look nicer */
.spa-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.setting-sidebar .accordion-button {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    padding: 12px 20px;
    background-color: transparent !important;
    box-shadow: none !important;
}

.setting-sidebar .accordion-button:not(.collapsed) {
    color: #1a1a1a;
    font-weight: 600;
}

.setting-sidebar .accordion-button::after {
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
}

.setting-sidebar .accordion-body {
    padding: 0;
}

.report-item-link {
    display: flex;
    align-items: center;
    padding: 8px 20px 8px 45px;
    color: #64748b;
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.report-item-link:hover, .report-item-link.active {
    background-color: var(--bs-main-o);
    color: var(--bs-main);
    border-left-color: var(--bs-main);
    font-weight: 500;
}

.report-item-link .rpt-icon {
    opacity: 0.6;
    margin-right: 8px;
    transition: opacity 0.2s ease;
}

.report-item-link:hover .rpt-icon, .report-item-link.active .rpt-icon {
    opacity: 1;
}

/* Responsive Setting Sidebar */
.setting-sidebar {
    width: 260px;
    flex-shrink: 0;
    overflow-y: hidden;
    transition: margin-left 0.3s ease;
}

.setting-sidebar.hide-desktop {
    margin-left: -260px;
}

@media (max-width: 767.98px) {
    .setting-sidebar {
        width: 100%;
        max-height: 50vh;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
        margin-left: 0 !important;
        overflow-y: auto;
    }
}

/* Custom Filter Switch (ON/OFF) */
.custom-filter-switch {
    user-select: none;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2.5px;
}

.custom-filter-switch .switch-label-off,
.custom-filter-switch .switch-label-on {
    display: inline-block;
    padding: 3.5px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #343a40;
}

.custom-filter-switch input[type="checkbox"]:not(:checked) ~ .switch-label-off {
    background-color: var(--red-o); /* light red */
    color: var(--red); /* red */
}

.custom-filter-switch input[type="checkbox"]:checked ~ .switch-label-on {
    background-color: var(--bs-main-100); /* light green */
    color: var(--bs-main-700); /* dark green */
}

/* Custom Flatpickr Theme - Apollo Green */
.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.selected.prevMonthDay, 
.flatpickr-day.startRange.prevMonthDay, 
.flatpickr-day.endRange.prevMonthDay, 
.flatpickr-day.selected.nextMonthDay, 
.flatpickr-day.startRange.nextMonthDay, 
.flatpickr-day.endRange.nextMonthDay {
    background: var(--bs-main) !important;
    border-color: var(--bs-main) !important;
}

.flatpickr-month,
.flatpickr-current-month .numInputWrapper, 
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #343a40 !important;
    fill: #343a40 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: transparent !important;
}

.flatpickr-weekdays .flatpickr-weekday {
    color: #1a1a1a !important;
    font-weight: 600;
}

.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after {
    border-bottom-color: #fff !important;
}

span.flatpickr-weekday {
    color: #000 !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--bs-main) !important;
}
.flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg {
    fill: var(--bs-main) !important;
}
/* Custom Report Table Styles */
#reportResultContainer {
    width: 100%;
    overflow: auto !important;
    position: relative;
    flex-grow: 1;
    min-height: 0;
    border-radius: 8px;
    background: #ffffff;
}

.custom-report-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.custom-report-table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.025em;
    padding: 12px 16px !important;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 2px solid #e2e8f0 !important;
    white-space: nowrap;
}

.custom-report-table tbody td {
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.custom-report-table tr:hover {
    background-color: #f8fafc;
}

#reportResultContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#reportResultContainer::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

#reportResultContainer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#reportResultContainer::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Group Header Row Styles */
.group-header-row {
    z-index: 5;
}

.group-header-row td {
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: #1e293b;
    font-weight: 700 !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.group-header-row.group-lv-1 td {
    background-color: #f1f5f9 !important;
    border-left: 4px solid var(--bs-primary) !important;
}

.group-header-row.group-lv-2 td {
    background-color: #f8fafc !important;
    border-left: 4px solid var(--bs-info) !important;
}

.group-header-row.group-lv-3 td {
    background-color: #ffffff !important;
    border-left: 4px solid var(--bs-success) !important;
}

.group-header-row:hover td {
    background-color: #e2e8f0 !important;
}

/* Group Summary Row Styles */
.group-summary-row td {
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 0.8rem;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    background-color: rgba(var(--bs-primary-rgb), 0.02) !important;
}

.group-summary-row.summary-sum td { color: var(--bs-primary); }
.group-summary-row.summary-avg td { color: var(--bs-info); }
.group-summary-row.summary-max td { color: var(--bs-success); }
.group-summary-row.summary-min td { color: var(--bs-warning); }

.group-summary-row:hover td {
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

/* Grand Total Footer Styles */
.custom-report-table tfoot tr td {
    background-color: #fff5f5 !important;
    color: #e53e3e !important;
    font-weight: 800 !important;
    font-size: 0.9rem;
    border-top: 1px solid #feb2b2 !important;
    border-bottom: 2px solid #e53e3e !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

.custom-report-table tfoot tr:first-child td {
    border-top: 4px double #feb2b2 !important;
}

.custom-report-table tfoot .agg-label {
    color: #c53030;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 900;
}

.filter-dropdown-menu {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2000;
    min-width: 350px;
    max-width: 90%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.report-filter-area::-webkit-scrollbar {
    width: 6px;
}

.report-filter-area::-webkit-scrollbar-track {
    background: #f8fafc;
}

.report-filter-area::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.filter-group .form-control {
    border-color: #e2e8f0 !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.filter-group .form-control:focus {
    border-color: var(--bs-main) !important;
    box-shadow: 0 0 0 3px var(--bs-main-o) !important;
}

.flatpickr-calendar {
    z-index: 9999 !important;
}

/* Ensure #viewSetting is always visible and takes up full container space when active */
#viewSetting.active, #viewSetting[style*="display"] {
    min-height: calc(100vh - 92px) !important;
    width: 100% !important;
    position: relative !important;
    z-index: 1 !important;
    background-color: #f8f9fa !important;
}

#viewSetting .tab-pane.active {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    min-height: 550px !important;
}

#viewSetting .tab-pane:not(.active) {
    display: none !important;
}


