/* ═══════════════════════════════════════════
   YUVENDA ARR Dashboard — Custom Styles
   ═══════════════════════════════════════════ */

/* ── Sidebar nav links ── */
.nav-link-item {
    transition: background-color 0.2s ease, color 0.15s ease, border-left 0.15s ease;
    border-left: 3px solid transparent;
}
.nav-link-item:hover {
    background-color: rgba(255,255,255,0.06) !important;
    color: #fff !important;
}

/* ── Mobile responsive: sidebar becomes top bar ── */
@media (max-width: 992px) {
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 0 8px !important;
        z-index: 1000 !important;
        overflow: visible !important;
    }
    /* Hide version badge and HR on mobile */
    #sidebar hr,
    #sidebar > div:last-child {
        display: none !important;
    }
    /* Logo section: compact */
    #sidebar > div:first-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 0 !important;
        flex-shrink: 0;
    }
    #sidebar > div:first-child > div {
        padding: 8px 12px 8px 8px !important;
    }
    #sidebar > div:first-child > p {
        display: none !important;
    }
    /* Nav links: horizontal row */
    #sidebar > div:nth-child(3) {
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    #sidebar > div:nth-child(3) a {
        border-left: none !important;
        white-space: nowrap;
    }
    #sidebar > div:nth-child(3) a > div {
        padding: 10px 12px !important;
    }
    /* Active nav on mobile: bottom border instead of left border */
    #sidebar > div:nth-child(3) a[style*="border-left: 3px solid rgb(26, 95, 58)"] {
        border-left: none !important;
        border-bottom: 3px solid #1a5f3a !important;
    }

    /* Content: push below top bar */
    #tab-content,
    div[style*="margin-left: 240px"] {
        margin-left: 0 !important;
        margin-top: 56px !important;
        padding: 12px 16px !important;
    }
}

/* ── Small mobile: even more compact ── */
@media (max-width: 576px) {
    #sidebar > div:nth-child(3) a > div {
        padding: 8px 8px !important;
    }
    #sidebar > div:nth-child(3) a > div > span:first-child {
        margin-right: 4px !important;
        font-size: 14px !important;
    }
    #sidebar > div:nth-child(3) a > div > span:last-child {
        font-size: 11px !important;
    }
    div[style*="margin-left: 240px"] {
        padding: 8px 10px !important;
    }
}

/* ── Inline filter bar dropdowns ── */
.filter-bar .Select-control,
.filter-bar .dash-dropdown .Select-control {
    font-size: 12px !important;
    border-radius: 6px !important;
}

/* ── Card hover lift ── */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06) !important;
}

/* ── Dropdown focus accent ring ── */
.Select.is-focused > .Select-control {
    border-color: #1a5f3a !important;
    box-shadow: 0 0 0 2px rgba(26,95,58,0.15) !important;
}
.dash-dropdown .Select.is-open > .Select-control {
    border-color: #1a5f3a !important;
}

/* ── Tab content fade-in ── */
#tab-content > * {
    animation: fadeSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Table styling ── */
table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}
table tbody tr {
    transition: background-color 0.15s ease;
}
table tbody tr:hover {
    background-color: rgba(26,95,58,0.04) !important;
}
table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #fff;
}

/* Dash DataTable overrides */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td {
    background-color: rgba(26,95,58,0.04) !important;
}

/* ── Radio/toggle buttons ── */
.form-check-input:checked {
    background-color: #1a5f3a !important;
    border-color: #1a5f3a !important;
}
.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(26,95,58,0.2) !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Sidebar scrollbar */
#sidebar::-webkit-scrollbar {
    width: 4px;
}
#sidebar::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

/* ── KPI card accent borders ── */
.kpi-positive {
    border-top: 4px solid #1a5f3a !important;
}
.kpi-negative {
    border-top: 4px solid #dc2626 !important;
}
.kpi-neutral {
    border-top: 4px solid #1a1a2e !important;
}

/* ── Chart container smooth resize ── */
.js-plotly-plot {
    transition: height 0.3s ease;
}

/* ── Checkbox styling ── */
.form-check-input[type="checkbox"]:checked {
    background-color: #1a5f3a !important;
    border-color: #1a5f3a !important;
}

/* ── Mobile-friendly filter bars ── */
@media (max-width: 992px) {
    .row > [class*="col-"] {
        margin-bottom: 8px;
    }
}

/* ── Charts responsive ── */
.js-plotly-plot .plotly .main-svg {
    max-width: 100%;
}
