/* Mobile Styles */

/* Mobile Navigation Slider */
.mobile-nav-slider {
    margin-top: 20px;
    margin-bottom: 20px;
}

.nav-slider-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-slider-container::-webkit-scrollbar {
    display: none;
}

.nav-slider-item {
    flex: 0 0 auto;
    width: 80px;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 12px;
}

.nav-slider-item .icon-box {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.nav-slider-item:active .icon-box {
    transform: scale(0.95);
}

/* Mobile Submenu */
.mobile-menu-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-menu-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.mobile-menu-btn i:first-child {
    margin-right: 15px;
    font-size: 1.2em;
    width: 25px;
    text-align: center;
}

.mobile-menu-btn:active {
    background-color: #f8f9fa;
    transform: scale(0.98);
}

.btn-back-dashboard {
    margin-top: 20px;
    border-radius: 10px;
    padding: 12px;
}

/* Responsive Media Queries */
@media (max-width: 767.98px) {
    /* Header improvements on mobile */
    .top-navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .user-info {
        align-items: flex-start;
    }

    .user-info .stack {
        align-items: flex-start;
    }

    .custom-date-wrapper {
        width: 100%;
    }

    /* Tab Content Fixed Height Override */
    .tab-content-fixed {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    /* Chart Fixed Height Override */
    .chart-fixed-height {
        height: auto !important;
        min-height: 250px;
    }

    /* Pastikan kontainer chart menyesuaikan tinggi konten (termasuk tombol) */
    .charts-row .chart-container {
        height: auto !important;
    }

    /* Hindari tombol prev/next ketutup: naikkan z-index dan beri background */
    .chart-navigation {
        position: relative;
        z-index: 10;
        background: #ffffff;
    }

    /* Sidebar Responsive */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle-btn {
        display: inline-block !important;
    }

    /* Mobile Table Card View */
    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    .table td:last-child {
        border-bottom: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        text-align: left;
        flex: 1;
        padding-right: 10px;
    }

    /* Mobile Specific Card Design (New) */
    .mobile-card-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-card-item {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        display: flex;
        flex-direction: column;
    }

    .mobile-card-content {
        width: 100%;
    }

    .mobile-card-title {
        font-size: 16px;
        font-weight: 600;
        color: #d9534f;
        /* Red/Highlighted color */
        margin-bottom: 5px;
    }

    .mobile-card-subtitle {
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-card-subtitle .code {
        font-weight: 600;
        color: #495057;
    }

    .mobile-card-subtitle .saldo {
        font-weight: 600;
        color: #2c3e50;
    }

    .mobile-card-footer {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        border-top: 1px solid #f0f0f0;
        padding-top: 10px;
        margin-top: 5px;
        font-size: 14px;
    }

    /* Scoped overrides for Accounts mobile list */
    .accounts-mobile .mobile-card-footer {
        justify-content: space-between;
        align-items: flex-start;
    }

    .accounts-mobile .mobile-card-info {
        text-align: left;
    }

    .accounts-mobile .mobile-card-item.is-parent .mobile-card-title,
    .accounts-mobile .mobile-card-item.is-parent .mobile-card-subtitle,
    .accounts-mobile .mobile-card-item.is-parent .mobile-card-info {
        font-weight: 700;
    }

    .accounts-mobile .mobile-card-item.is-level1 .mobile-card-title,
    .accounts-mobile .mobile-card-item.is-level1 .mobile-card-subtitle,
    .accounts-mobile .mobile-card-item.is-level1 .mobile-card-info {
        font-weight: 700;
    }

    /* Actions row: Lvl + buttons sejajar kiri */
    .accounts-mobile .actions-row {
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
    }
    .accounts-mobile .actions-row .lvl {
        font-weight: 600;
        color: #2c3e50;
    }
    .accounts-mobile .actions-row .actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-card-footer strong {
        color: #333;
    }

    /* Hide Table on Mobile when Card List is present */
    .d-md-none .mobile-card-list {
        display: flex;
    }

    /* Utility to hide table on mobile if we use this structure */
    .mobile-hidden-table {
        display: none;
    }
}