/* Card Container: Default sebagai Grid pada layar PC/Laptop (> 768px) untuk halaman tanpa tabel */
.mobile-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 12px;
}

/* KECUALI: Jika halaman memiliki tabel desktop normal (.table-wrapper), sembunyikan card container di PC/Laptop */
@media (min-width: 769px) {
    body:has(.table-wrapper) .mobile-card-container {
        display: none !important;
    }
}

/* Tampilan Khusus Mobile <= 768px */
@media (max-width: 768px) {
    body:has(.mobile-card-container:not([style*="display:none"]):not([style*="display: none"])) .table-wrapper {
        display: none !important;
    }

    .mobile-card-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .page-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .page-tabs>div {
        flex-direction: column;
        width: 100%;
    }

    .search-wrapper input,
    .filter-select,
    input[type="month"] {
        width: 100% !important;
    }
}

/* Style Card (Berlaku Global untuk PC/Laptop maupun Mobile) */
.mobile-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.mc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.mc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid #eff6ff;
}

.mc-user-info {
    flex: 1;
    overflow: hidden;
}

.mc-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-role {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.mc-status {
    flex-shrink: 0;
}

.mc-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    flex: 1;
}

.mc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.mc-label {
    color: #000000;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mc-value {
    font-weight: 600;
    color: #334155;
}

.mc-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.mc-btn-detail {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #4338ca;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s, border-color 0.2s;
}

.mc-btn-detail:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.mc-btn-detail:active {
    background: #e0e7ff;
}

.filter-input {
    min-width: 200px;
}