/* =============================
   PAGE HEADER
============================= */
.page-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}
.page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin: 0;
}

/* =============================
   TABLE SECTION
============================= */
.table-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}
.table-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.section-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}
.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    letter-spacing: 0.3px;
}
.section-badge.pasar-uang {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}
.section-badge.pendapatan-tetap {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}
.section-badge.pendapatan-syariah {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}
.section-badge.reksa-indeks {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}
.section-badge.saham {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9f1239;
}

/* =============================
   TABLE STYLES
============================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive::-webkit-scrollbar {
    height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.reksa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}
.reksa-table span {
    font-size: 0.8rem;
}
.reksa-table thead th {
    background: #f9fafb;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    text-align: left;
}
.reksa-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}
.reksa-table tbody tr:hover {
    background: #fafbfc;
    transform: scale(1.001);
}
.reksa-table tbody td {
    padding: 1.125rem 1.5rem;
    color: var(--text-dark);
    vertical-align: middle;
    border-bottom: 2px solid #f3f4f6;
}
.product-name {
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.4;
    max-width: 400px;
}

/* =============================
   PERFORMANCE BADGES
============================= */
.performance {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.performance.positive {
    background: #d1fae5;
    color: #065f46;
}
.performance.negative {
    background: #fee2e2;
    color: #991b1b;
}
.performance.neutral {
    background: #f3f4f6;
    color: var(--text-light);
}

/* =============================
   TABLE NOTE
============================= */
.table-note {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.table-note p {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

/* =============================
   TEXT ALIGNMENT
============================= */
.text-end {
    text-align: right;
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 1199px) {
    .reksa-table {
        font-size: 0.8125rem;
    }
    .reksa-table thead th,
    .reksa-table tbody td {
        padding: 1rem 1.25rem;
    }
}
@media (max-width: 991px) {
    .page-title {
        font-size: 1.5rem;
    }
    .reksa-table thead th,
    .reksa-table tbody td {
        padding: 0.875rem 1rem;
    }
    .product-name {
        max-width: 300px;
    }
}
@media (max-width: 768px) {
    .page-header {
        padding-bottom: 0.75rem;
    }
    .page-title {
        font-size: 1.375rem;
    }
    .page-subtitle {
        font-size: 0.875rem;
    }
    .section-header {
        padding: 0.875rem 1rem;
    }
    .section-badge {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
    .reksa-table {
        font-size: 0.75rem;
    }
    .reksa-table thead th {
        padding: 0.75rem 0.875rem;
        font-size: 0.75rem;
    }
    .reksa-table tbody td {
        padding: 0.875rem;
    }
    .product-name {
        font-size: 0.8125rem;
        max-width: 250px;
    }
    .performance {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    .table-note {
        padding: 0.875rem 1rem;
    }
    .table-note p {
        font-size: 0.8125rem;
    }
}
@media (max-width: 576px) {
    .table-section {
        border-radius: 12px;
    }
    .reksa-table thead th,
    .reksa-table tbody td {
        padding: 0.75rem;
    }
    .product-name {
        max-width: 200px;
        font-size: 0.75rem;
    }
}

/* =============================
   TAB NAVIGATION
============================= */
.portfolio-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-x: auto;
}
.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab-btn:hover {
    background: #e5e7eb;
    color: #374151;
}
.tab-btn.active {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* =============================
   EMPTY STATE
============================= */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.empty-icon {
    margin-bottom: 1.5rem;
    color: #d1d5db;
}

.empty-icon svg {
        margin: 0 auto;
    }

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}
.empty-text {
    color: #6b7280;
    margin-bottom: 2rem;
}

/* =============================
   BUTTONS & SUMMARY GRID
============================= */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-primary-custom:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.summary-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    border-radius: 15px;
    color: #fff;
    border: none;
}

.summary-label {
        font-size: 0.875rem;
        opacity: 0.9;
        margin-bottom: 0.5rem;
    }

    .summary-value {
        font-size: 1.75rem;
        font-weight: 700;
    }

    .summary-value .badge {
       padding: 6px 12px;
        border-radius: 20px;
        font-size: 1.2rem;
        font-weight: 600;
        color: #fff;
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    }

     /* Portfolio Grid - Optimized */
    .portfolio-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
        margin-top: 2rem;
    }

    /* Portfolio Card - Compact */
    .portfolio-card {
        background: white;
        border-radius: 14px;
        padding: 1.25rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
        transition: all 0.3s ease;
        border: 1px solid #f3f4f6;
    }

    .portfolio-card:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-4px);
    }

    /* Card Header - Compact */
    .card-header-section {
        display: flex;
        align-items: flex-start;
        gap: 0.875rem;
        margin-bottom: 1rem;
        position: relative;
    }

    .icon-wrapper {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        flex-shrink: 0;
        overflow: hidden;
    }

    .product-logo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .card-title-section {
        flex: 1;
        min-width: 0;
        padding-right: 60px;
    }

    .card-title {
        font-size: 1rem;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 0.25rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-subtitle {
        font-size: 0.75rem;
        color: #6b7280;
        margin: 0;
    }

    /* Amount Section - Compact */
    .card-amount-section {
        margin-bottom: 1rem;
    }

    .amount-label {
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.25rem;
    }

    .card-amount {
        font-size: 1.375rem;
        font-weight: 700;
        color: #111827;
        margin: 0;
    }

    /* Status Badge */
    .status-badge {
        position: absolute;
        top: 0;
        right: 0;
        padding: 0.25rem 0.625rem;
        border-radius: 20px;
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    .status-pending {
        background: #fef3c7;
        color: #92400e;
    }

    .status-proses {
        background: #dbeafe;
        color: #1e40af;
    }

    .status-success {
        background: #d1fae5;
        color: #065f46;
    }

    .status-gagal {
        background: #fee2e2;
        color: #991b1b;
    }

    /* Divider */
    .card-divider {
        height: 1px;
        background: linear-gradient(to right, transparent, #e5e7eb, transparent);
        margin: 1rem 0;
    }

    /* Card Details - Compact */
    .card-details {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
    }

    .detail-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }

    .detail-label {
        font-size: 0.8125rem;
        color: #6b7280;
        font-weight: 500;
    }

    .detail-value {
        font-size: 0.8125rem;
        font-weight: 600;
        color: #374151;
        text-align: right;
    }

    /* Card Actions - Compact */
    .card-actions {
        display: flex;
        gap: 0.625rem;
        margin-top: 0.875rem;
    }

    .btn-action {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        padding: 0.5rem 0.875rem;
        border-radius: 8px;
        font-size: 0.8125rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .btn-detail {
        background: #f3f4f6;
        color: #374151;
        border: 1px solid #e5e7eb;
    }

    .btn-detail:hover {
        background: #e5e7eb;
        transform: translateY(-2px);
    }

    .btn-invest {
        background: #10b981;
        color: white;
        border: none;
    }

    .btn-invest:hover {
        background: #059669;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        color: white;
    }

    .btn-invest-sell {
        background: #ff0000;
        color: white;
        border: none;
    }

    .btn-invest-sell:hover {
        background: #5c0000;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(4, 94, 64, 0.3);
        color: white;
    }


    .btn-invest-buy {
        background: rgb(22, 85, 129);
        color: white;
        border: none;
    }

    .btn-invest-buy:hover {
        background: rgb(41, 170, 226);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(4, 94, 64, 0.3);
        color: white;
    }


    /* Transaction Details */
    .detail-transactions {
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .transactions-title {
        font-size: 0.9375rem;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 0.875rem;
        margin-top: 0.875rem;
    }

    .transactions-list {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
        max-height: 280px;
        overflow-y: auto;
    }

    .transaction-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.625rem;
        background: #f9fafb;
        border-radius: 8px;
        border: 1px solid #f3f4f6;
    }

    .transaction-info {
        flex: 1;
    }

    .transaction-date {
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.25rem;
    }

    .transaction-amount {
        font-size: 0.875rem;
        font-weight: 600;
        color: #1f2937;
    }

    .transaction-status {
        padding: 0.25rem 0.625rem;
        border-radius: 20px;
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .portfolio-tabs {
            width: 100%;
            justify-content: flex-start;
        }

        .summary-grid {
            grid-template-columns: 1fr;
        }

        .page-title {
            font-size: 1.5rem;
        }

        .card-amount {
            font-size: 1.25rem;
        }
    }

    @media (max-width: 480px) {
        .portfolio-card {
            padding: 1rem;
        }

        .icon-wrapper {
            width: 44px;
            height: 44px;
        }

        .card-actions {
            flex-direction: column;
        }

        .btn-action {
            width: 100%;
        }

        .card-title {
            font-size: 0.9375rem;
        }
    }

    /* Scrollbar untuk tabs */
    .portfolio-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .portfolio-tabs::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 4px;
    }

    .portfolio-tabs::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }

    .portfolio-tabs::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* =============================
   PORTFOLIO & CARDS
============================= */
/* (Bagian portfolio-card, card-header-section, btn-invest, dsb tetap sama seperti style ketiga milikmu) */

.portfolio-tabs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .tab-btn {
        border: none;
        background-color: #f1f1f1;
        padding: 8px 16px;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        transition: background-color 0.3s, color 0.3s;
    }

    .tab-btn:hover {
        background-color: #e2e2e2;
    }

    .tab-btn.active {
        background-color: #198754;
        color: white;
    }

    .tab-content {
        display: none;
    }

    .tab-content.active {
        display: block;
    }

    .reksa-row {
        transition: background-color 0.2s ease;
    }
    .reksa-row:hover {
        background-color: rgba(0, 123, 255, 0.05);
    }
