/* ============================================================
   BUKTI BAYAR — Responsive Card View (Publik)
   Konsisten dengan admin_bukti_redesign.css card-mode
   - Desktop (≥769px): table horizontal normal
   - Mobile (≤768px): each <tr> jadi card dengan left-accent
   - Tombol Lihat + Unduh dipisah untuk UX lebih jelas
   ============================================================ */

/* ===== TABLE WRAP — desktop only ===== */
.bukti-table-wrap {
    background: #ffffff;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.bukti-table-wrap::-webkit-scrollbar { height: 8px; }
.bukti-table-wrap::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.bukti-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.bukti-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== BUKTI TABLE — Desktop default ===== */
.bukti-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.bukti-table th {
    background: linear-gradient(180deg, var(--slate-50) 0%, var(--slate-100) 100%);
    color: var(--slate-700);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.4px;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid var(--slate-200);
}
.bukti-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    color: var(--slate-700);
}
.bukti-table tbody tr:hover { background: var(--slate-50); }
.bukti-table .col-nop {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--navy);
}
.bukti-table .col-amount { text-align: right; font-weight: 700; color: var(--slate-800); }

/* Tombol Lihat & Unduh (pemisahan jelas untuk publik) */
.bukti-file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--navy);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.bukti-file-link:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 30, 61, 0.25);
}
.bukti-file-link::before { content: '📎'; }

.bukti-file-download {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    margin-left: 6px;
    border-radius: 8px;
    background: var(--success, #10b981);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.bukti-file-download:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.bukti-file-download::before { content: '⬇️'; }

.bukti-file-meta {
    display: block;
    color: var(--slate-400);
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.2;
}

/* Wrap 2 tombol sejajar */
.bukti-file-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================================
   MOBILE CARD MODE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .bukti-table-wrap {
        background: transparent;
        border-radius: 0;
        overflow: visible;
    }
    .bukti-table,
    .bukti-table thead,
    .bukti-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }
    /* Hide header row on mobile */
    .bukti-table thead {
        position: absolute;
        left: -9999px;
    }
    /* Each tr becomes a card */
    .bukti-table tbody tr {
        display: block;
        background: #ffffff;
        border-radius: 12px;
        padding: 0;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
        position: relative;
        overflow: hidden;
    }
    /* Border-left accent (default slate, override per status) */
    .bukti-table tbody tr::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: #cbd5e1;
    }
    .bukti-table tbody tr.bukti-row-lunas::before { background: #10b981; }
    .bukti-table tbody tr.bukti-row-pending::before { background: #f59e0b; }
    .bukti-table tbody tr.bukti-row-rejected::before { background: #ef4444; }
    .bukti-table tbody tr.bukti-row-offline::before { background: #6366f1; }

    /* NOP card header (gradient atas, konsisten dgn admin) */
    .bukti-table td.col-nop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 14px;
        background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
        border-bottom: 1px solid #e2e8f0;
        font-size: 13px;
        color: var(--navy);
        word-break: break-all;
        font-family: ui-monospace, 'SF Mono', monospace;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    .bukti-table td.col-nop::before { content: ''; }

    /* Each other td: label:value row */
    .bukti-table td {
        padding: 8px 14px !important;
        border-bottom: 1px dashed var(--slate-100) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
        text-align: right !important;
        font-size: 13px;
    }
    .bukti-table td:last-child {
        border-bottom: none !important;
        padding-bottom: 12px !important;
    }
    /* Prepend label via ::before from data-label */
    .bukti-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--slate-500);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        text-align: left;
        flex-shrink: 0;
    }
    /* Hide label untuk td.col-nop (sudah header card) */
    .bukti-table td.col-nop::before { content: none; }

    /* Tagihan full width di mobile */
    .bukti-table td.bukti-tagihan {
        font-size: 14px;
        font-weight: 700;
        color: var(--navy);
    }

    /* Tombol Lihat & Unduh full width di mobile */
    .bukti-file-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
    }
    .bukti-file-link,
    .bukti-file-download {
        justify-content: center;
        margin-left: 0;
        padding: 10px 12px;
        font-size: 13px;
    }
    .bukti-file-meta {
        text-align: center;
        margin-top: 4px;
    }

    /* Pill (status) tetap inline */
    .bukti-table .pill {
        font-size: 11px !important;
        padding: 3px 9px !important;
    }

    /* Empty state center */
    .bukti-empty {
        text-align: center;
        padding: 32px 16px;
    }
    .bukti-empty-icon { font-size: 48px; margin-bottom: 12px; }
    .bukti-empty-title { font-weight: 700; color: var(--slate-700); margin-bottom: 4px; }
    .bukti-empty-sub { color: var(--slate-500); font-size: 13px; }
}