/* ========== DASHBOARD - Modern Light UI ========== */
.sifu-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sifu-dashboard .card {
    border-radius: 14px;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.25s, transform 0.25s;
    background: #fff;
}

.sifu-dashboard .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Attention Bar */
.dash-attention-bar {
    background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
    border: 1px solid #f5e6cc;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #9a7b3d;
    font-weight: 500;
}

.dash-attention-bar i {
    font-size: 18px;
    color: #d4a843;
}

.dash-attention-link {
    color: #d4a843;
    font-size: 16px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    transition: color 0.2s;
}

.dash-attention-link:hover {
    color: #ef5122;
    text-decoration: none;
}

/* Overdue Invoices Bar */
.dash-overdue-bar {
    background: #fff;
    border-radius: 14px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
}

.overdue-label {
    min-width: 80px;
}

.overdue-title {
    font-size: 10px;
    font-weight: 700;
    color: #a0a5ab;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.4;
}

.overdue-segments {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.overdue-segment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fb;
    border-radius: 10px;
    font-size: 12px;
    transition: background 0.2s;
}

.overdue-segment:hover {
    background: #f0f2f5;
}

.overdue-total {
    background: #f0f2f5;
}

.segment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-green {
    background: #43a047;
}

.dot-yellow {
    background: #ef5122;
}

.dot-red {
    background: #e53935;
}

.dot-dark {
    background: #1a1d4e;
}

.segment-label {
    color: #b0b5bb;
    font-size: 11px;
    white-space: nowrap;
    font-weight: 500;
}

.segment-value {
    color: #2d3436;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* Filter Bar */
.dash-filter-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.dash-filter-btns {
    display: flex;
    gap: 3px;
    background: #f4f5f7;
    border-radius: 10px;
    padding: 4px;
}

.dash-filter-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 7px 18px;
    border: none;
    background: transparent;
    color: #a0a5ab;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.dash-filter-btn:hover {
    color: #2d3436;
    background: rgba(255, 255, 255, 0.6);
}

.dash-filter-btn:focus {
    outline: none;
    box-shadow: none;
}

.dash-filter-btn.active {
    background: #fff;
    color: #2d3436;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.dash-custom-dates {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-custom-dates .form-control {
    font-size: 12px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e0e3e8;
}

.dash-custom-dates .btn-primary {
    background: #ef5122;
    border-color: #ef5122;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.dash-custom-dates .btn-primary:hover {
    background: #d94518;
}

/* Stats Row */
.dash-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 4px;
}

.dash-stats-row>.col {
    flex: 1 1 0;
    min-width: 0;
    max-width: 20%;
    padding-left: 8px;
    padding-right: 8px;
}

.dash-stat-card {
    border-radius: 14px !important;
    min-height: 120px;
    cursor: pointer;
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07) !important;
}

.dash-stat-card .card-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dash-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #b0b5bb;
    margin-bottom: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #1a1d21;
    margin-bottom: 8px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
}

.dash-stat-change {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 500;
}

.dash-stat-change i {
    font-size: 14px;
}

.dash-stat-change.text-success {
    color: #43a047 !important;
}

.dash-stat-change.text-danger {
    color: #e53935 !important;
}

.dash-stat-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.dash-stat-link:hover {
    text-decoration: none !important;
}

/* Pending Bar */
.dash-pending-bar {
    display: flex;
    gap: 24px;
    padding: 10px 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dash-pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-pending-label {
    font-size: 12px;
    color: #a0a5ab;
    font-weight: 500;
}

.dash-pending-count {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    min-width: 32px;
    text-align: center;
}

/* Card Titles */
.dash-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1d21;
    letter-spacing: -0.2px;
}

/* View All Link */
.dash-view-all {
    font-size: 12px;
    color: #ef5122;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.dash-view-all:hover {
    color: #d94518;
    text-decoration: none;
}

/* Chart/Table Rows */
.dash-chart-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dash-chart-row>[class*="col-"] {
    display: flex;
    margin-bottom: 0;
    padding-left: 10px;
    padding-right: 10px;
}

.dash-chart-row .card {
    width: 100%;
}

.dash-table-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dash-table-row>[class*="col-"] {
    display: flex;
    margin-bottom: 0;
}

.dash-table-row .card {
    width: 100%;
}

/* Dashboard Tables */
.dash-table th {
    font-size: 10px;
    font-weight: 700;
    color: #b0b5bb;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-top: none;
    background: #f8f9fb;
    padding: 10px 12px;
    white-space: nowrap;
}

.dash-table td {
    font-size: 13px;
    padding: 10px 12px;
    font-weight: 500;
    border-top: 1px solid #f4f5f7;
    vertical-align: middle;
    color: #4a4f55;
}

.dash-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.dash-table tbody tr:hover td {
    background: #f0f2f5 !important;
    transition: background 0.2s;
}

.dash-table .badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Clickable Rows */
.dash-clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

/* Clickable Stalled Items */
.dash-clickable-stalled {
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid #f4f5f7;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 0 -4px;
}

.dash-clickable-stalled:hover {
    background: #f8f9fb;
    text-decoration: none;
    color: inherit;
}

.dash-clickable-stalled:last-child {
    border-bottom: none;
}

/* Stalled Requests List */
.stalled-list {
    max-height: 320px;
    overflow-y: auto;
}

.stalled-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stalled-uid {
    font-size: 10px;
    color: #c0c5cb;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stalled-name {
    font-size: 13px;
    color: #2d3436;
    font-weight: 600;
}

.stalled-badge .badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Badge overrides - logo palette */
.sifu-dashboard .badge-soft-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.sifu-dashboard .badge-soft-danger {
    background: #ffebee;
    color: #c62828;
}

.sifu-dashboard .badge-soft-warning {
    background: #fff3e0;
    color: #ef5122;
}

.sifu-dashboard .badge-soft-info {
    background: #e3f2fd;
    color: #1565c0;
}

.sifu-dashboard .badge-soft-secondary {
    background: #f5f5f5;
    color: #78909c;
}

/* Customize Dropdown */
.dash-customize-btn {
    font-size: 12px;
    color: #a0a5ab;
    border: 1px solid #e8eaed;
    background: #fff;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.dash-customize-btn:hover {
    color: #2d3436;
    border-color: #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dash-customize-menu {
    width: 420px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    border: 1px solid #f0f1f3;
}

.dash-cust-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #5a5f65;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 0;
    font-weight: 500;
}

.dash-cust-check input[type="checkbox"] {
    accent-color: #ef5122;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Section visibility */
.dash-section-hidden {
    display: none !important;
}

/* Scroll offset for anchor links (topbar clearance) */
[id^="section-"] {
    scroll-margin-top: 80px;
}

/* Page-load overlay styles moved to inline <style> at top of view for immediate effect */

/* ── Floating TOC FAB button ── */
.dash-toc-fab {
    position: fixed;
    right: 20px;
    bottom: 28px;
    z-index: 995;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ef5122;
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 14px rgba(239, 81, 34, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dash-toc-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 81, 34, .45);
    color: #fff !important;
}

.dash-toc-fab .mdi {
    font-size: 20px;
    color: #fff;
}

.dash-toc-fab:focus {
    outline: none;
}

/* TOC panel - slides in when .open */
.dash-toc {
    position: fixed;
    right: 20px;
    bottom: 82px;
    z-index: 996;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .12);
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 230px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.dash-toc::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.dash-toc.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}

.dash-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #f4f5f7;
    margin-bottom: 6px;
}

.dash-toc-title {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.dash-toc-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.dash-toc-close:hover {
    color: #ef5122;
}

.dash-toc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all .15s ease;
    cursor: pointer;
}

.dash-toc-link .mdi {
    font-size: 16px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color .15s ease;
}

.dash-toc-link:hover {
    background: rgba(239, 81, 34, .08);
    color: #ef5122;
    text-decoration: none !important;
}

.dash-toc-link:hover .mdi {
    color: #ef5122;
}

.dash-toc-link.active {
    background: rgba(239, 81, 34, .12);
    color: #ef5122;
    font-weight: 600;
}

.dash-toc-link.active .mdi {
    color: #ef5122;
}

@media (max-width: 768px) {
    .dash-toc-fab {
        width: 40px;
        height: 40px;
        right: 14px;
        bottom: 20px;
    }

    .dash-toc-fab .mdi {
        font-size: 18px;
    }

    .dash-toc {
        width: 210px;
        right: 14px;
        bottom: 68px;
        max-height: 60vh;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f5f6f8 25%, #eceef0 50%, #f5f6f8 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 10px;
}

.skeleton-text {
    display: block;
}

.dash-skeleton-block {
    padding: 10px 0;
}

/* Override ApexCharts tooltip */
.sifu-dashboard .apexcharts-tooltip {
    background: #fff !important;
    border: 1px solid #f0f1f3 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
}

.sifu-dashboard .apexcharts-tooltip .apexcharts-tooltip-title {
    background: #f8f9fb !important;
    border-bottom: 1px solid #f0f1f3 !important;
    font-size: 11px !important;
    color: #78909c !important;
    font-weight: 600 !important;
}

.sifu-dashboard .apexcharts-tooltip .apexcharts-tooltip-series-group {
    padding: 5px 10px !important;
}

.sifu-dashboard .apexcharts-xaxistooltip {
    background: #2d3436 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.sifu-dashboard .apexcharts-xaxistooltip:before,
.sifu-dashboard .apexcharts-xaxistooltip:after {
    border-bottom-color: #2d3436 !important;
}

.analytics-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: #fff;
    transition: opacity 0.5s ease;
    border-radius: 14px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Analytics Tables */
.dash-analytics-table {
    width: 100%;
    font-size: 12px;
}

.dash-analytics-table th {
    font-size: 10px;
    text-transform: uppercase;
    color: #b0b5bb;
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 1px solid #f4f5f7;
    letter-spacing: 0.6px;
}

.dash-analytics-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f8f9fb;
    color: #4a4f55;
    font-size: 13px;
    font-weight: 500;
}

.dash-analytics-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.dash-analytics-table tbody tr:hover {
    background: #f0f2f5;
}

.dash-analytics-table tr:last-child td {
    border-bottom: none;
}

/* Analytics Stat */
.dash-analytics-stat {
    text-align: center;
    padding: 14px 0;
}

.dash-analytics-stat .stat-big {
    font-size: 36px;
    font-weight: 800;
    color: #1a1d21;
    line-height: 1;
    letter-spacing: -1px;
}

.dash-analytics-stat .stat-label {
    font-size: 10px;
    color: #b0b5bb;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
    .dash-stats-row>.col {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        margin-bottom: 14px;
    }

    .dash-stat-value {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .dash-stats-row>.col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .overdue-segments {
        gap: 8px;
    }

    .dash-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .dash-stats-row>.col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}